home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / daemons / rpc.000 / rpc
Tape Archive  |  1996-02-01  |  70.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Tape Archive (archive/tar).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Tape Archive (archive/tar) magic Supported
100% file POSIX tar archive (GNU) default
99% file POSIX tar archive (GNU), directory rpc.rstatd-3.03/, mode 40755 , uid 0 , gid 0 , size 0 , seconds 6104046126, user root, group root default
98% file data default
62% TrID TAR - Tape ARchive (GNU) default
37% TrID TAR - Tape ARchive (directory) default
100% siegfried x-fmt/265 Tape Archive Format default
100% lsar Tar default
100% gt2 TAR Archiv gefunden (Auflistung ist deaktiviert) default
100% disktype GNU tar archive default
100% detectItEasy Archive: tar default
100% binwalkID POSIX tar archive (GNU), owner user name: "td-3.03/" default
100% xdgMime application/x-tar default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 72 70 63 2e 72 73 74 61 | 74 64 2d 33 2e 30 33 2f |rpc.rsta|td-3.03/|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 20 34 30 37 | 35 35 20 00 20 20 20 20 |.... 407|55 . |
|00000070| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00000080| 20 20 20 20 20 20 30 20 | 20 36 31 30 34 30 34 36 | 0 | 6104046|
|00000090| 31 32 36 20 20 31 31 35 | 30 34 00 20 35 00 00 00 |126 115|04. 5...|
|000000a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000000f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000100| 00 75 73 74 61 72 20 20 | 00 72 6f 6f 74 00 00 00 |.ustar |.root...|
|00000110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000120| 00 00 00 00 00 00 00 00 | 00 72 6f 6f 74 00 00 00 |........|.root...|
|00000130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000001f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000200| 72 70 63 2e 72 73 74 61 | 74 64 2d 33 2e 30 33 2f |rpc.rsta|td-3.03/|
|00000210| 4d 61 6b 65 66 69 6c 65 | 00 00 00 00 00 00 00 00 |Makefile|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000240| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000250| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000260| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 20 20 |....1006|44 . |
|00000270| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00000280| 20 20 20 33 31 35 30 20 | 20 36 31 30 34 30 34 33 | 3150 | 6104043|
|00000290| 35 30 36 20 20 31 33 32 | 33 37 00 20 30 00 00 00 |506 132|37. 0...|
|000002a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000002f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000300| 00 75 73 74 61 72 20 20 | 00 72 6f 6f 74 00 00 00 |.ustar |.root...|
|00000310| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000320| 00 00 00 00 00 00 00 00 | 00 72 6f 6f 74 00 00 00 |........|.root...|
|00000330| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000340| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000350| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000360| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000380| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000390| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000003f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000400| 23 20 4d 61 6b 65 20 66 | 69 6c 65 20 66 6f 72 20 |# Make f|ile for |
|00000410| 6d 6f 64 69 66 69 65 64 | 20 72 70 63 2e 72 73 74 |modified| rpc.rst|
|00000420| 61 74 64 20 73 65 65 20 | 52 45 41 44 4d 45 20 66 |atd see |README f|
|00000430| 6f 72 20 64 65 74 61 69 | 6c 73 2e 0a 20 20 20 20 |or detai|ls.. |
|00000440| 20 20 20 20 20 43 43 20 | 3d 20 67 63 63 20 0a 20 | CC |= gcc . |
|00000450| 20 20 20 20 52 50 43 47 | 45 4e 20 3d 20 2f 6c 6f | RPCG|EN = /lo|
|00000460| 63 61 6c 2f 62 69 6e 2f | 72 70 63 67 65 6e 0a 20 |cal/bin/|rpcgen. |
|00000470| 20 20 20 20 43 46 4c 41 | 47 53 20 3d 20 2d 4f 32 | CFLA|GS = -O2|
|00000480| 20 2d 70 69 70 65 20 2d | 66 6f 6d 69 74 2d 66 72 | -pipe -|fomit-fr|
|00000490| 61 6d 65 2d 70 6f 69 6e | 74 65 72 20 24 28 4f 50 |ame-poin|ter $(OP|
|000004a0| 54 49 4f 4e 53 29 0a 20 | 20 20 20 4c 44 46 4c 41 |TIONS). | LDFLA|
|000004b0| 47 53 20 3d 20 0a 20 20 | 20 20 20 42 49 4e 44 49 |GS = . | BINDI|
|000004c0| 52 20 3d 20 2f 75 73 72 | 2f 62 69 6e 0a 20 20 20 |R = /usr|/bin. |
|000004d0| 20 53 42 49 4e 44 49 52 | 20 3d 20 2f 75 73 72 2f | SBINDIR| = /usr/|
|000004e0| 73 62 69 6e 0a 20 20 20 | 20 20 4d 41 4e 44 49 52 |sbin. | MANDIR|
|000004f0| 20 3d 20 2f 75 73 72 2f | 6d 61 6e 0a 20 20 20 20 | = /usr/|man. |
|00000500| 20 52 50 43 4c 49 42 20 | 3d 20 23 20 2d 6c 72 70 | RPCLIB |= # -lrp|
|00000510| 63 6c 69 62 20 0a 20 20 | 20 20 4f 50 54 49 4f 4e |clib . | OPTION|
|00000520| 53 20 3d 20 2d 44 4e 4f | 52 50 43 4c 49 42 20 2d |S = -DNO|RPCLIB -|
|00000530| 44 4e 45 54 5f 49 46 41 | 43 45 3d 5c 22 65 74 68 |DNET_IFA|CE=\"eth|
|00000540| 30 5c 22 0a 0a 61 6c 6c | 3a 20 72 70 63 2e 72 73 |0\"..all|: rpc.rs|
|00000550| 74 61 74 64 20 72 75 70 | 20 72 73 79 73 69 6e 66 |tatd rup| rsysinf|
|00000560| 6f 0a 0a 69 6e 73 74 61 | 6c 6c 3a 20 61 6c 6c 0a |o..insta|ll: all.|
|00000570| 09 69 6e 73 74 61 6c 6c | 20 2d 6d 20 36 34 34 20 |.install| -m 644 |
|00000580| 2d 6f 20 72 6f 6f 74 20 | 2d 67 20 72 6f 6f 74 20 |-o root |-g root |
|00000590| 20 72 73 74 61 74 2e 68 | 20 2f 75 73 72 2f 69 6e | rstat.h| /usr/in|
|000005a0| 63 6c 75 64 65 2f 72 70 | 63 73 76 63 0a 09 69 6e |clude/rp|csvc..in|
|000005b0| 73 74 61 6c 6c 20 2d 6d | 20 36 34 34 20 2d 6f 20 |stall -m| 644 -o |
|000005c0| 72 6f 6f 74 20 2d 67 20 | 72 6f 6f 74 20 20 72 73 |root -g |root rs|
|000005d0| 74 61 74 2e 78 20 2f 75 | 73 72 2f 69 6e 63 6c 75 |tat.x /u|sr/inclu|
|000005e0| 64 65 2f 72 70 63 73 76 | 63 0a 09 69 6e 73 74 61 |de/rpcsv|c..insta|
|000005f0| 6c 6c 20 2d 6d 20 37 35 | 30 20 2d 6f 20 72 6f 6f |ll -m 75|0 -o roo|
|00000600| 74 20 2d 67 20 62 69 6e | 20 20 72 70 63 2e 72 73 |t -g bin| rpc.rs|
|00000610| 74 61 74 64 20 24 28 53 | 42 49 4e 44 49 52 29 2f |tatd $(S|BINDIR)/|
|00000620| 72 70 63 2e 72 73 74 61 | 74 64 0a 09 69 6e 73 74 |rpc.rsta|td..inst|
|00000630| 61 6c 6c 20 2d 6d 20 37 | 35 35 20 2d 6f 20 72 6f |all -m 7|55 -o ro|
|00000640| 6f 74 20 2d 67 20 62 69 | 6e 20 20 72 75 70 20 24 |ot -g bi|n rup $|
|00000650| 28 42 49 4e 44 49 52 29 | 2f 72 75 70 0a 09 69 6e |(BINDIR)|/rup..in|
|00000660| 73 74 61 6c 6c 20 2d 6d | 20 37 35 35 20 2d 6f 20 |stall -m| 755 -o |
|00000670| 72 6f 6f 74 20 2d 67 20 | 62 69 6e 20 72 73 79 73 |root -g |bin rsys|
|00000680| 69 6e 66 6f 20 24 28 42 | 49 4e 44 49 52 29 2f 72 |info $(B|INDIR)/r|
|00000690| 73 79 73 69 6e 66 6f 0a | 09 69 6e 73 74 61 6c 6c |sysinfo.|.install|
|000006a0| 20 2d 6d 20 36 34 34 20 | 2d 6f 20 72 6f 6f 74 20 | -m 644 |-o root |
|000006b0| 2d 67 20 62 69 6e 20 72 | 73 74 61 74 64 2e 38 20 |-g bin r|statd.8 |
|000006c0| 24 28 4d 41 4e 44 49 52 | 29 2f 6d 61 6e 38 2f 72 |$(MANDIR|)/man8/r|
|000006d0| 73 74 61 74 64 2e 38 0a | 09 69 6e 73 74 61 6c 6c |statd.8.|.install|
|000006e0| 20 2d 6d 20 36 34 34 20 | 2d 6f 20 72 6f 6f 74 20 | -m 644 |-o root |
|000006f0| 2d 67 20 62 69 6e 20 72 | 70 63 2e 72 73 74 61 74 |-g bin r|pc.rstat|
|00000700| 64 2e 38 20 24 28 4d 41 | 4e 44 49 52 29 2f 6d 61 |d.8 $(MA|NDIR)/ma|
|00000710| 6e 31 2f 72 70 63 2e 72 | 73 74 61 74 64 2e 38 0a |n1/rpc.r|statd.8.|
|00000720| 09 69 6e 73 74 61 6c 6c | 20 2d 6d 20 36 34 34 20 |.install| -m 644 |
|00000730| 2d 6f 20 72 6f 6f 74 20 | 2d 67 20 62 69 6e 20 72 |-o root |-g bin r|
|00000740| 75 70 2e 31 20 24 28 4d | 41 4e 44 49 52 29 2f 6d |up.1 $(M|ANDIR)/m|
|00000750| 61 6e 31 2f 72 75 70 2e | 31 0a 09 69 6e 73 74 61 |an1/rup.|1..insta|
|00000760| 6c 6c 20 2d 6d 20 36 34 | 34 20 2d 6f 20 72 6f 6f |ll -m 64|4 -o roo|
|00000770| 74 20 2d 67 20 62 69 6e | 20 72 73 79 73 69 6e 66 |t -g bin| rsysinf|
|00000780| 6f 2e 31 20 24 28 4d 41 | 4e 44 49 52 29 2f 6d 61 |o.1 $(MA|NDIR)/ma|
|00000790| 6e 31 2f 72 73 79 73 69 | 6e 66 6f 2e 31 0a 0a 72 |n1/rsysi|nfo.1..r|
|000007a0| 70 63 2e 72 73 74 61 74 | 64 20 3a 20 72 73 74 61 |pc.rstat|d : rsta|
|000007b0| 74 5f 73 72 76 63 2e 6f | 20 72 73 74 61 74 5f 78 |t_srvc.o| rstat_x|
|000007c0| 64 72 2e 6f 20 72 73 74 | 61 74 5f 70 72 6f 63 2e |dr.o rst|at_proc.|
|000007d0| 6f 0a 09 24 28 43 43 29 | 20 72 73 74 61 74 5f 73 |o..$(CC)| rstat_s|
|000007e0| 72 76 63 2e 6f 20 72 73 | 74 61 74 5f 78 64 72 2e |rvc.o rs|tat_xdr.|
|000007f0| 6f 20 72 73 74 61 74 5f | 70 72 6f 63 2e 6f 20 2d |o rstat_|proc.o -|
|00000800| 6f 20 24 40 20 24 28 52 | 50 43 4c 49 42 29 0a 0a |o $@ $(R|PCLIB)..|
|00000810| 72 75 70 20 3a 20 72 75 | 70 2e 6f 20 72 73 74 61 |rup : ru|p.o rsta|
|00000820| 74 5f 63 6c 6e 74 2e 6f | 20 72 73 74 61 74 5f 78 |t_clnt.o| rstat_x|
|00000830| 64 72 2e 6f 20 72 73 74 | 61 74 2e 68 20 0a 09 24 |dr.o rst|at.h ..$|
|00000840| 28 43 43 29 20 72 75 70 | 2e 6f 20 72 73 74 61 74 |(CC) rup|.o rstat|
|00000850| 5f 63 6c 6e 74 2e 6f 20 | 72 73 74 61 74 5f 78 64 |_clnt.o |rstat_xd|
|00000860| 72 2e 6f 20 2d 6f 20 24 | 40 20 24 28 52 50 43 4c |r.o -o $|@ $(RPCL|
|00000870| 49 42 29 0a 0a 72 73 79 | 73 69 6e 66 6f 20 3a 20 |IB)..rsy|sinfo : |
|00000880| 72 73 79 73 69 6e 66 6f | 2e 6f 20 72 73 74 61 74 |rsysinfo|.o rstat|
|00000890| 5f 63 6c 6e 74 2e 6f 20 | 72 73 74 61 74 5f 78 64 |_clnt.o |rstat_xd|
|000008a0| 72 2e 6f 20 72 73 74 61 | 74 2e 68 20 0a 09 24 28 |r.o rsta|t.h ..$(|
|000008b0| 43 43 29 20 72 73 79 73 | 69 6e 66 6f 2e 6f 20 72 |CC) rsys|info.o r|
|000008c0| 73 74 61 74 5f 63 6c 6e | 74 2e 6f 20 72 73 74 61 |stat_cln|t.o rsta|
|000008d0| 74 5f 78 64 72 2e 6f 20 | 2d 6f 20 24 40 20 24 28 |t_xdr.o |-o $@ $(|
|000008e0| 52 50 43 4c 49 42 29 0a | 0a 72 73 74 61 74 2e 68 |RPCLIB).|.rstat.h|
|000008f0| 20 72 73 74 61 74 5f 63 | 6c 6e 74 2e 63 20 72 73 | rstat_c|lnt.c rs|
|00000900| 74 61 74 5f 78 64 72 2e | 63 20 3a 20 72 73 74 61 |tat_xdr.|c : rsta|
|00000910| 74 2e 78 0a 09 24 28 52 | 50 43 47 45 4e 29 20 72 |t.x..$(R|PCGEN) r|
|00000920| 73 74 61 74 2e 78 0a 09 | 2d 72 6d 20 2d 66 20 72 |stat.x..|-rm -f r|
|00000930| 73 74 61 74 5f 73 76 63 | 2e 63 0a 0a 25 2e 6f 20 |stat_svc|.c..%.o |
|00000940| 3a 20 25 2e 63 20 72 73 | 74 61 74 2e 68 0a 09 24 |: %.c rs|tat.h..$|
|00000950| 28 43 43 29 20 2d 63 20 | 24 28 43 46 4c 41 47 53 |(CC) -c |$(CFLAGS|
|00000960| 29 20 24 3c 20 2d 6f 20 | 24 40 0a 0a 70 61 74 63 |) $< -o |$@..patc|
|00000970| 68 20 3a 20 63 6c 6e 74 | 2e 68 2e 64 69 66 66 0a |h : clnt|.h.diff.|
|00000980| 09 70 61 74 63 68 20 2d | 75 20 2f 75 73 72 2f 69 |.patch -|u /usr/i|
|00000990| 6e 63 6c 75 64 65 2f 72 | 70 63 2f 63 6c 6e 74 2e |nclude/r|pc/clnt.|
|000009a0| 68 20 63 6c 6e 74 2e 68 | 2e 64 69 66 66 0a 0a 75 |h clnt.h|.diff..u|
|000009b0| 6e 70 61 74 63 68 20 3a | 20 63 6c 6e 74 2e 68 2e |npatch :| clnt.h.|
|000009c0| 64 69 66 66 0a 09 70 61 | 74 63 68 20 2d 75 20 2d |diff..pa|tch -u -|
|000009d0| 52 20 2f 75 73 72 2f 69 | 6e 63 6c 75 64 65 2f 72 |R /usr/i|nclude/r|
|000009e0| 70 63 2f 63 6c 6e 74 2e | 68 20 63 6c 6e 74 2e 68 |pc/clnt.|h clnt.h|
|000009f0| 2e 64 69 66 66 0a 0a 63 | 6c 65 61 6e 3a 0a 09 2d |.diff..c|lean:..-|
|00000a00| 72 6d 20 2d 66 20 72 70 | 63 2e 72 73 74 61 74 64 |rm -f rp|c.rstatd|
|00000a10| 20 72 73 74 61 74 20 72 | 75 70 20 72 73 79 73 69 | rstat r|up rsysi|
|00000a20| 6e 66 6f 20 2a 2e 6f 20 | 63 6f 72 65 20 61 2e 6f |nfo *.o |core a.o|
|00000a30| 75 74 0a 09 2d 72 6d 20 | 2d 66 20 72 73 74 61 74 |ut..-rm |-f rstat|
|00000a40| 2e 68 20 72 73 74 61 74 | 5f 63 6c 6e 74 2e 63 20 |.h rstat|_clnt.c |
|00000a50| 72 73 74 61 74 5f 73 76 | 63 2e 63 20 72 73 74 61 |rstat_sv|c.c rsta|
|00000a60| 74 5f 78 64 72 2e 63 0a | 00 00 00 00 00 00 00 00 |t_xdr.c.|........|
|00000a70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b00| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c00| 72 70 63 2e 72 73 74 61 | 74 64 2d 33 2e 30 33 2f |rpc.rsta|td-3.03/|
|00000c10| 52 45 41 44 4d 45 00 00 | 00 00 00 00 00 00 00 00 |README..|........|
|00000c20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000c60| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 20 20 |....1006|44 . |
|00000c70| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00000c80| 20 20 20 35 32 32 32 20 | 20 36 31 30 34 30 34 32 | 5222 | 6104042|
|00000c90| 36 34 36 20 20 31 32 34 | 36 35 00 20 30 00 00 00 |646 124|65. 0...|
|00000ca0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000ce0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000cf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d00| 00 75 73 74 61 72 20 20 | 00 72 6f 6f 74 00 00 00 |.ustar |.root...|
|00000d10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d20| 00 00 00 00 00 00 00 00 | 00 72 6f 6f 74 00 00 00 |........|.root...|
|00000d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000e00| 54 75 65 20 4a 61 6e 20 | 39 2c 20 31 39 39 36 0a |Tue Jan |9, 1996.|
|00000e10| 0a 54 68 69 73 20 69 73 | 20 53 75 6e 27 73 20 72 |.This is| Sun's r|
|00000e20| 70 63 2e 72 73 74 61 74 | 64 20 70 6f 72 74 65 64 |pc.rstat|d ported|
|00000e30| 20 74 6f 20 6c 69 6e 75 | 78 20 77 69 74 68 20 61 | to linu|x with a|
|00000e40| 20 6e 65 77 20 66 65 61 | 74 75 72 65 20 61 6e 64 | new fea|ture and|
|00000e50| 20 61 20 6e 65 77 20 63 | 6c 69 65 6e 74 0a 74 6f | a new c|lient.to|
|00000e60| 20 65 78 70 6c 6f 69 74 | 20 74 68 61 74 20 6e 65 | exploit| that ne|
|00000e70| 77 20 66 65 61 74 75 72 | 65 2e 20 0a 0a 41 75 74 |w featur|e. ..Aut|
|00000e80| 68 6f 72 3a 20 41 64 61 | 6d 20 4d 69 67 75 73 20 |hor: Ada|m Migus |
|00000e90| 28 61 6d 69 67 75 73 40 | 63 73 2e 6d 75 6e 2e 63 |(amigus@|cs.mun.c|
|00000ea0| 61 29 0a 4f 72 69 67 69 | 6e 61 6c 3a 20 53 75 6e |a).Origi|nal: Sun|
|00000eb0| 20 4d 69 63 72 6f 53 79 | 73 74 65 6d 73 2e 0a 0a | MicroSy|stems...|
|00000ec0| 72 70 63 2e 72 73 74 61 | 74 64 20 63 6f 6c 6c 65 |rpc.rsta|td colle|
|00000ed0| 63 74 73 20 6b 65 72 6e | 65 6c 20 69 6e 66 6f 72 |cts kern|el infor|
|00000ee0| 6d 61 74 69 6f 6e 20 6f | 6e 20 74 68 65 20 68 6f |mation o|n the ho|
|00000ef0| 73 74 20 6d 61 63 68 69 | 6e 65 2c 20 20 49 20 68 |st machi|ne, I h|
|00000f00| 61 76 65 20 70 6f 72 74 | 65 64 0a 53 75 6e 27 73 |ave port|ed.Sun's|
|00000f10| 20 76 65 72 73 69 6f 6e | 20 6f 66 20 74 68 69 73 | version| of this|
|00000f20| 20 64 61 65 6d 6f 6e 20 | 74 6f 20 75 73 65 20 74 | daemon |to use t|
|00000f30| 68 65 20 70 72 6f 63 20 | 66 69 6c 65 20 73 79 73 |he proc |file sys|
|00000f40| 74 65 6d 2e 20 20 4f 75 | 74 70 75 74 20 6c 6f 6f |tem. Ou|tput loo|
|00000f50| 6b 20 73 69 6d 69 6c 61 | 72 0a 4f 75 74 70 75 74 |k simila|r.Output|
|00000f60| 20 6c 6f 6f 6b 20 73 69 | 6d 69 6c 61 72 20 74 6f | look si|milar to|
|00000f70| 20 6d 75 6e 2d 72 75 70 | 74 69 6d 65 20 28 66 6f | mun-rup|time (fo|
|00000f80| 75 6e 64 20 6f 6e 20 66 | 74 70 2e 63 73 2e 6d 75 |und on f|tp.cs.mu|
|00000f90| 6e 2e 63 61 29 2e 0a 49 | 20 68 61 76 65 20 61 64 |n.ca)..I| have ad|
|00000fa0| 64 65 64 20 74 68 65 20 | 61 62 69 6c 69 74 79 20 |ded the |ability |
|00000fb0| 6f 66 20 65 78 74 72 61 | 63 74 69 6e 67 20 74 68 |of extra|cting th|
|00000fc0| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 75 73 65 72 |e number| of user|
|00000fd0| 73 20 6f 6e 20 74 68 65 | 20 72 65 6d 6f 74 65 20 |s on the| remote |
|00000fe0| 68 6f 73 74 0a 61 6e 64 | 20 61 20 6e 65 77 20 22 |host.and| a new "|
|00000ff0| 72 75 70 22 20 63 6c 69 | 65 6e 74 20 77 68 69 63 |rup" cli|ent whic|
|00001000| 68 20 65 78 70 6c 6f 69 | 74 73 20 74 68 61 74 20 |h exploi|ts that |
|00001010| 66 65 61 74 75 72 65 2e | 0a 0a 09 2a 20 42 6f 74 |feature.|...* Bot|
|00001020| 68 20 74 68 65 20 6e 65 | 77 20 63 6c 69 65 6e 74 |h the ne|w client|
|00001030| 20 61 6e 64 20 64 61 65 | 6d 6f 6e 20 72 65 6d 61 | and dae|mon rema|
|00001040| 69 6e 20 62 61 63 6b 77 | 61 72 64 6c 79 20 63 6f |in backw|ardly co|
|00001050| 6d 70 61 74 69 62 6c 65 | 20 77 69 74 68 20 0a 09 |mpatible| with ..|
|00001060| 20 20 70 72 65 76 69 6f | 75 73 20 76 65 72 73 69 | previo|us versi|
|00001070| 6f 6e 73 2e 0a 0a 72 70 | 63 2e 72 73 74 61 74 64 |ons...rp|c.rstatd|
|00001080| 20 63 61 6e 20 62 65 20 | 6c 6f 61 64 65 64 20 66 | can be |loaded f|
|00001090| 72 6f 6d 20 74 68 65 20 | 63 6f 6d 6d 61 6e 64 20 |rom the |command |
|000010a0| 6c 69 6e 65 20 62 75 74 | 20 69 73 20 75 73 75 61 |line but| is usua|
|000010b0| 6c 6c 79 20 65 78 65 63 | 75 74 65 64 20 76 69 61 |lly exec|uted via|
|000010c0| 0a 69 6e 65 74 64 28 38 | 29 2e 0a 0a 54 6f 20 49 |.inetd(8|)...To I|
|000010d0| 6e 73 74 61 6c 6c 3a 0a | 0a 45 64 69 74 20 74 68 |nstall:.|.Edit th|
|000010e0| 65 20 4d 61 6b 65 66 69 | 6c 65 20 61 6e 64 20 61 |e Makefi|le and a|
|000010f0| 64 64 20 74 68 65 20 6f | 70 74 69 6f 6e 20 4e 4f |dd the o|ption NO|
|00001100| 52 50 43 4c 49 42 20 69 | 66 20 79 6f 75 72 20 72 |RPCLIB i|f your r|
|00001110| 70 63 20 66 75 6e 63 74 | 69 6f 6e 73 20 61 72 65 |pc funct|ions are|
|00001120| 20 62 75 69 6c 74 0a 69 | 6e 74 6f 20 6c 69 62 63 | built.i|nto libc|
|00001130| 20 28 61 73 20 74 68 65 | 79 20 61 72 65 20 6f 6e | (as the|y are on|
|00001140| 20 6d 6f 73 74 20 6c 69 | 6e 75 78 20 6d 61 63 68 | most li|nux mach|
|00001150| 69 6e 65 73 29 2e 20 20 | 41 6c 73 6f 20 79 6f 75 |ines). |Also you|
|00001160| 20 77 69 6c 6c 20 68 61 | 76 65 20 74 6f 20 63 6f | will ha|ve to co|
|00001170| 6d 6d 65 6e 74 0a 6f 75 | 74 20 74 68 65 20 63 61 |mment.ou|t the ca|
|00001180| 6c 6c 20 2d 6c 72 70 63 | 6c 69 62 2e 0a 49 66 20 |ll -lrpc|lib..If |
|00001190| 79 6f 75 20 68 61 76 65 | 20 61 20 6e 65 74 77 6f |you have| a netwo|
|000011a0| 72 6b 20 69 6e 74 65 72 | 66 61 63 65 20 6f 74 68 |rk inter|face oth|
|000011b0| 65 72 20 74 68 61 6e 20 | 22 65 74 68 30 22 20 74 |er than |"eth0" t|
|000011c0| 68 61 74 20 61 70 70 65 | 61 72 73 20 69 6e 0a 2f |hat appe|ars in./|
|000011d0| 70 72 6f 63 2f 6e 65 74 | 2f 64 65 76 2c 20 6c 69 |proc/net|/dev, li|
|000011e0| 6b 65 20 22 74 75 30 22 | 2c 20 22 73 6c 30 22 20 |ke "tu0"|, "sl0" |
|000011f0| 65 74 63 20 79 6f 75 20 | 63 61 6e 20 64 65 66 69 |etc you |can defi|
|00001200| 6e 65 20 69 74 20 61 73 | 20 74 68 65 20 69 6e 74 |ne it as| the int|
|00001210| 65 72 66 61 63 65 20 66 | 6f 72 0a 72 73 74 61 74 |erface f|or.rstat|
|00001220| 64 20 74 6f 20 6d 6f 6e | 69 74 65 72 20 62 79 20 |d to mon|iter by |
|00001230| 61 64 64 69 6e 67 3a 0a | 09 2d 44 4e 45 54 5f 49 |adding:.|.-DNET_I|
|00001240| 46 41 43 45 3d 5c 22 3c | 64 65 76 69 63 65 3e 5c |FACE=\"<|device>\|
|00001250| 22 0a 74 6f 20 74 68 65 | 20 6f 70 74 69 6f 6e 73 |".to the| options|
|00001260| 20 6c 69 6e 65 20 69 6e | 20 74 68 65 20 4d 61 6b | line in| the Mak|
|00001270| 65 66 69 6c 65 2e 0a 0a | 41 70 70 65 6e 64 20 74 |efile...|Append t|
|00001280| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 6c 69 6e |he follo|wing lin|
|00001290| 65 20 74 6f 20 79 6f 75 | 72 20 2f 65 74 63 2f 69 |e to you|r /etc/i|
|000012a0| 6e 65 74 64 2e 63 6f 6e | 66 0a 0a 72 73 74 61 74 |netd.con|f..rstat|
|000012b0| 64 2f 31 2d 35 20 64 67 | 72 61 6d 09 72 70 63 2f |d/1-5 dg|ram.rpc/|
|000012c0| 75 64 70 20 77 61 69 74 | 09 72 6f 6f 74 09 2f 75 |udp wait|.root./u|
|000012d0| 73 72 2f 73 62 69 6e 2f | 72 70 63 2e 72 73 74 61 |sr/sbin/|rpc.rsta|
|000012e0| 74 64 20 20 72 70 63 2e | 72 73 74 61 74 64 0a 0a |td rpc.|rstatd..|
|000012f0| 54 68 69 73 20 64 61 65 | 6d 6f 6e 20 69 73 20 63 |This dae|mon is c|
|00001300| 75 72 72 65 6e 74 6c 79 | 20 69 6d 70 6c 65 6d 65 |urrently| impleme|
|00001310| 6e 74 65 64 20 6f 6e 20 | 61 6c 6c 20 6c 69 6e 75 |nted on |all linu|
|00001320| 78 20 6d 61 63 68 69 6e | 65 20 6f 6e 20 6d 79 20 |x machin|e on my |
|00001330| 6c 6f 63 61 6c 20 63 61 | 6d 70 75 73 0a 61 6e 64 |local ca|mpus.and|
|00001340| 20 69 74 20 77 6f 72 6b | 69 6e 67 20 71 75 69 74 | it work|ing quit|
|00001350| 65 20 77 65 6c 6c 2c 20 | 62 75 74 20 69 74 20 68 |e well, |but it h|
|00001360| 61 73 20 6f 6e 6c 79 20 | 62 65 65 6e 20 74 65 73 |as only |been tes|
|00001370| 74 65 64 20 66 6f 72 20 | 6c 69 6e 75 78 2d 31 2e |ted for |linux-1.|
|00001380| 32 2e 38 2e 0a 41 6e 79 | 20 62 75 67 20 72 65 70 |2.8..Any| bug rep|
|00001390| 6f 72 74 73 2c 20 63 6f | 6d 6d 65 6e 74 73 2c 20 |orts, co|mments, |
|000013a0| 65 74 63 2e 20 73 65 6e | 74 20 74 6f 20 74 68 65 |etc. sen|t to the|
|000013b0| 20 62 65 6c 6f 77 20 61 | 64 64 72 65 73 73 2e 0a | below a|ddress..|
|000013c0| 0a 54 6f 20 49 6e 73 74 | 61 6c 6c 20 63 6c 6e 74 |.To Inst|all clnt|
|000013d0| 2e 68 2e 70 61 74 63 68 | 3a 20 28 73 65 65 20 62 |.h.patch|: (see b|
|000013e0| 65 6c 6f 77 20 66 6f 72 | 20 64 65 74 61 69 6c 73 |elow for| details|
|000013f0| 29 0a 0a 49 6e 20 2f 75 | 73 72 2f 69 6e 63 6c 75 |)..In /u|sr/inclu|
|00001400| 64 65 2f 72 70 63 20 74 | 79 70 65 20 70 61 74 63 |de/rpc t|ype patc|
|00001410| 68 20 2d 70 30 20 3c 20 | 63 6c 6e 74 2e 68 2e 70 |h -p0 < |clnt.h.p|
|00001420| 61 74 63 68 0a 0a 42 55 | 47 46 49 58 45 53 20 33 |atch..BU|GFIXES 3|
|00001430| 2e 30 33 0a 0a 46 69 78 | 65 64 20 69 6e 63 6f 72 |.03..Fix|ed incor|
|00001440| 72 65 63 74 20 6e 75 6d | 62 65 72 73 20 69 6e 20 |rect num|bers in |
|00001450| 20 69 70 61 63 6b 65 74 | 73 2c 20 6f 70 61 63 6b | ipacket|s, opack|
|00001460| 65 74 73 2c 20 65 74 63 | 2e 20 66 6f 72 20 31 2e |ets, etc|. for 1.|
|00001470| 32 2e 31 33 2c 20 61 6e | 64 20 66 6f 72 0a 31 2e |2.13, an|d for.1.|
|00001480| 33 2e 78 78 2e 20 54 68 | 61 6e 6b 73 20 66 6f 72 |3.xx. Th|anks for|
|00001490| 20 73 6f 6d 65 20 68 65 | 6c 70 20 77 69 74 68 20 | some he|lp with |
|000014a0| 74 68 65 20 70 61 74 63 | 68 20 66 72 6f 6d 3a 0a |the patc|h from:.|
|000014b0| 09 4a 65 6e 73 20 4d 61 | 75 72 65 72 20 28 6a 6d |.Jens Ma|urer (jm|
|000014c0| 61 75 72 65 72 40 63 63 | 6b 2e 75 6e 69 2d 6b 6c |aurer@cc|k.uni-kl|
|000014d0| 2e 64 65 29 0a 0a 46 69 | 78 65 64 20 69 6e 66 69 |.de)..Fi|xed infi|
|000014e0| 6e 69 74 65 20 6c 6f 6f | 70 20 70 72 6f 62 6c 65 |nite loo|p proble|
|000014f0| 6d 20 69 66 20 49 46 41 | 43 45 20 77 61 73 6e 27 |m if IFA|CE wasn'|
|00001500| 74 20 69 6e 20 2f 70 72 | 6f 63 2f 6e 65 74 2f 64 |t in /pr|oc/net/d|
|00001510| 65 76 20 61 6c 6c 20 74 | 68 65 20 74 69 6d 65 0a |ev all t|he time.|
|00001520| 65 67 2e 20 70 70 70 30 | 2e 20 20 53 74 61 74 27 |eg. ppp0|. Stat'|
|00001530| 73 20 61 72 65 20 6e 6f | 77 20 72 65 69 6e 69 74 |s are no|w reinit|
|00001540| 69 61 6c 69 7a 65 64 20 | 74 6f 20 7a 65 72 6f 20 |ialized |to zero |
|00001550| 61 73 20 77 65 6c 6c 2e | 20 20 54 68 61 6e 6b 73 |as well.| Thanks|
|00001560| 20 66 6f 72 20 74 68 65 | 0a 70 61 74 63 68 20 66 | for the|.patch f|
|00001570| 72 6f 6d 3a 0a 09 43 61 | 72 6c 6f 73 20 46 6f 6e |rom:..Ca|rlos Fon|
|00001580| 73 65 63 61 20 28 66 6f | 6e 73 65 63 61 40 61 63 |seca (fo|nseca@ac|
|00001590| 73 65 2e 73 68 65 66 2e | 61 63 2e 75 6b 29 0a 0a |se.shef.|ac.uk)..|
|000015a0| 49 20 68 61 76 65 20 61 | 6c 73 6f 20 61 64 64 65 |I have a|lso adde|
|000015b0| 64 20 61 20 71 75 69 63 | 6b 20 68 61 63 6b 20 63 |d a quic|k hack c|
|000015c0| 61 6c 6c 65 64 20 22 72 | 73 79 73 69 6e 66 6f 22 |alled "r|sysinfo"|
|000015d0| 20 74 6f 20 65 78 74 72 | 61 63 74 20 61 6e 64 20 | to extr|act and |
|000015e0| 70 72 69 6e 74 20 61 6c | 6c 0a 74 68 65 20 69 6e |print al|l.the in|
|000015f0| 66 6f 72 6d 61 74 69 6f | 6e 20 63 6f 6c 6c 65 63 |formatio|n collec|
|00001600| 74 65 64 20 62 79 20 72 | 73 74 61 74 64 2e 20 20 |ted by r|statd. |
|00001610| 54 68 69 73 20 69 73 20 | 61 6c 73 6f 20 61 6e 20 |This is |also an |
|00001620| 69 64 65 61 20 6f 66 20 | 4a 65 6e 73 20 4d 61 75 |idea of |Jens Mau|
|00001630| 72 65 72 0a 77 68 6f 20 | 73 75 62 6d 69 74 74 65 |rer.who |submitte|
|00001640| 64 20 63 6f 64 65 20 66 | 6f 72 20 74 68 65 20 70 |d code f|or the p|
|00001650| 72 6f 67 72 61 6d 20 61 | 73 20 77 65 6c 6c 2e 0a |rogram a|s well..|
|00001660| 0a 4b 4e 4f 57 4e 20 42 | 55 47 53 20 28 69 66 20 |.KNOWN B|UGS (if |
|00001670| 79 6f 75 20 6b 6e 6f 77 | 20 68 6f 77 20 74 6f 20 |you know| how to |
|00001680| 66 69 78 20 74 68 65 6d | 20 65 6d 61 69 6c 20 6d |fix them| email m|
|00001690| 65 29 0a 0a 57 68 65 6e | 20 63 6f 6d 70 69 6c 69 |e)..When| compili|
|000016a0| 6e 67 20 74 68 65 72 65 | 20 61 72 65 20 76 61 72 |ng there| are var|
|000016b0| 69 6f 75 73 20 22 69 6e | 63 6f 6d 70 61 74 69 62 |ious "in|compatib|
|000016c0| 6c 65 20 70 6f 69 6e 74 | 65 72 20 74 79 70 65 73 |le point|er types|
|000016d0| 22 20 65 72 72 6f 72 73 | 2e 20 20 54 68 65 73 65 |" errors|. These|
|000016e0| 0a 61 72 65 20 63 61 75 | 73 65 64 20 62 79 20 64 |.are cau|sed by d|
|000016f0| 65 63 6c 61 72 61 74 69 | 6f 6e 73 2f 6d 61 63 72 |eclarati|ons/macr|
|00001700| 6f 73 20 69 6e 20 2f 75 | 73 72 2f 69 6e 63 6c 75 |os in /u|sr/inclu|
|00001710| 64 65 2f 72 70 63 2f 78 | 64 72 2e 68 2c 20 61 6e |de/rpc/x|dr.h, an|
|00001720| 64 20 6f 72 20 6f 6e 65 | 73 20 69 6e 0a 2f 75 73 |d or one|s in./us|
|00001730| 72 2f 69 6e 63 6c 75 64 | 65 2f 72 70 63 2f 63 6c |r/includ|e/rpc/cl|
|00001740| 6e 74 2e 68 2e 20 20 49 | 20 68 61 76 65 20 69 6e |nt.h. I| have in|
|00001750| 63 6c 75 64 65 64 20 61 | 20 70 61 74 63 68 20 66 |cluded a| patch f|
|00001760| 6f 72 20 63 6c 6e 74 2e | 68 20 74 68 61 74 20 77 |or clnt.|h that w|
|00001770| 69 6c 6c 20 67 65 74 0a | 72 69 64 20 6f 66 20 74 |ill get.|rid of t|
|00001780| 68 65 73 65 20 65 72 72 | 6f 72 73 2e 20 20 48 6f |hese err|ors. Ho|
|00001790| 77 20 65 76 65 72 20 73 | 69 6e 63 65 20 74 68 65 |w ever s|ince the|
|000017a0| 79 20 61 72 65 20 68 61 | 72 6d 6c 65 73 73 20 69 |y are ha|rmless i|
|000017b0| 6e 73 74 61 6c 6c 69 6e | 67 20 74 68 65 20 0a 70 |nstallin|g the .p|
|000017c0| 61 74 63 68 20 69 73 20 | 6e 6f 74 20 6e 65 73 73 |atch is |not ness|
|000017d0| 65 73 73 61 72 79 2e 0a | 0a 57 69 74 68 20 73 6f |essary..|.With so|
|000017e0| 6d 65 20 76 65 72 73 69 | 6f 6e 73 20 6f 66 20 72 |me versi|ons of r|
|000017f0| 70 63 6c 69 62 20 74 68 | 65 20 63 6f 6d 70 69 6c |pclib th|e compil|
|00001800| 65 64 20 22 72 75 70 22 | 20 6d 61 79 20 6e 6f 74 |ed "rup"| may not|
|00001810| 20 62 72 6f 61 64 63 61 | 73 74 20 63 6f 72 72 65 | broadca|st corre|
|00001820| 63 74 6c 79 2e 0a 54 68 | 69 73 20 69 73 20 61 6e |ctly..Th|is is an|
|00001830| 6f 74 68 65 72 20 72 65 | 61 73 6f 6e 20 77 68 79 |other re|ason why|
|00001840| 20 69 74 20 69 73 20 72 | 65 63 6f 6d 6d 65 6e 64 | it is r|ecommend|
|00001850| 65 64 20 74 6f 20 75 73 | 65 20 62 75 69 6c 74 20 |ed to us|e built |
|00001860| 69 6e 20 6c 69 62 63 20 | 72 70 63 20 73 74 75 66 |in libc |rpc stuf|
|00001870| 66 2e 0a 0a 41 64 61 6d | 20 4d 69 67 75 73 2c 20 |f...Adam| Migus, |
|00001880| 61 6d 69 67 75 73 40 63 | 73 2e 6d 75 6e 2e 63 61 |amigus@c|s.mun.ca|
|00001890| 20 0a 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 | .......|........|
|000018a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000018f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001900| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001910| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001920| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001930| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001940| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001950| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001980| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001990| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000019f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a00| 72 70 63 2e 72 73 74 61 | 74 64 2d 33 2e 30 33 2f |rpc.rsta|td-3.03/|
|00001a10| 72 73 74 61 74 5f 70 72 | 6f 63 2e 63 00 00 00 00 |rstat_pr|oc.c....|
|00001a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001a60| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 20 20 |....1006|44 . |
|00001a70| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00001a80| 20 20 32 31 35 36 32 20 | 20 36 31 30 34 30 34 32 | 21562 | 6104042|
|00001a90| 36 34 36 20 20 31 34 31 | 35 36 00 20 30 00 00 00 |646 141|56. 0...|
|00001aa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ac0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ad0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001af0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b00| 00 75 73 74 61 72 20 20 | 00 72 6f 6f 74 00 00 00 |.ustar |.root...|
|00001b10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b20| 00 00 00 00 00 00 00 00 | 00 72 6f 6f 74 00 00 00 |........|.root...|
|00001b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bf0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001c00| 2f 2a 0a 20 2a 20 20 72 | 70 63 2e 72 73 74 61 74 |/*. * r|pc.rstat|
|00001c10| 64 20 76 65 72 73 69 6f | 6e 20 33 2e 30 33 20 72 |d versio|n 3.03 r|
|00001c20| 70 63 20 72 65 6d 6f 74 | 65 20 73 74 61 74 69 73 |pc remot|e statis|
|00001c30| 74 69 63 73 20 64 61 65 | 6d 6f 6e 2e 0a 20 2a 20 |tics dae|mon.. * |
|00001c40| 20 43 6f 70 79 72 69 67 | 68 74 20 28 43 29 20 31 | Copyrig|ht (C) 1|
|00001c50| 39 39 35 20 20 41 64 61 | 6d 20 4d 69 67 75 73 2c |995 Ada|m Migus,|
|00001c60| 20 4d 65 6d 6f 72 69 61 | 6c 20 55 6e 69 76 65 72 | Memoria|l Univer|
|00001c70| 73 69 74 79 20 6f 66 20 | 4e 65 77 66 6f 75 6e 64 |sity of |Newfound|
|00001c80| 6c 61 6e 64 0a 20 2a 09 | 28 4d 55 4e 29 0a 20 2a |land. *.|(MUN). *|
|00001c90| 0a 20 2a 20 20 54 68 69 | 73 20 70 72 6f 67 72 61 |. * Thi|s progra|
|00001ca0| 6d 20 69 73 20 66 72 65 | 65 20 73 6f 66 74 77 61 |m is fre|e softwa|
|00001cb0| 72 65 3b 20 79 6f 75 20 | 63 61 6e 20 72 65 64 69 |re; you |can redi|
|00001cc0| 73 74 72 69 62 75 74 65 | 20 69 74 20 61 6e 64 2f |stribute| it and/|
|00001cd0| 6f 72 20 6d 6f 64 69 66 | 79 0a 20 2a 20 20 69 74 |or modif|y. * it|
|00001ce0| 20 75 6e 64 65 72 20 74 | 68 65 20 74 65 72 6d 73 | under t|he terms|
|00001cf0| 20 6f 66 20 74 68 65 20 | 47 4e 55 20 47 65 6e 65 | of the |GNU Gene|
|00001d00| 72 61 6c 20 50 75 62 6c | 69 63 20 4c 69 63 65 6e |ral Publ|ic Licen|
|00001d10| 73 65 20 61 73 20 70 75 | 62 6c 69 73 68 65 64 20 |se as pu|blished |
|00001d20| 62 79 0a 20 2a 20 20 74 | 68 65 20 46 72 65 65 20 |by. * t|he Free |
|00001d30| 53 6f 66 74 77 61 72 65 | 20 46 6f 75 6e 64 61 74 |Software| Foundat|
|00001d40| 69 6f 6e 3b 20 65 69 74 | 68 65 72 20 76 65 72 73 |ion; eit|her vers|
|00001d50| 69 6f 6e 20 31 2c 20 6f | 72 20 28 61 74 20 79 6f |ion 1, o|r (at yo|
|00001d60| 75 72 20 6f 70 74 69 6f | 6e 29 0a 20 2a 20 20 61 |ur optio|n). * a|
|00001d70| 6e 79 20 6c 61 74 65 72 | 20 76 65 72 73 69 6f 6e |ny later| version|
|00001d80| 2e 0a 20 2a 0a 20 2a 20 | 20 54 68 69 73 20 70 72 |.. *. * | This pr|
|00001d90| 6f 67 72 61 6d 20 69 73 | 20 64 69 73 74 72 69 62 |ogram is| distrib|
|00001da0| 75 74 65 64 20 69 6e 20 | 74 68 65 20 68 6f 70 65 |uted in |the hope|
|00001db0| 20 74 68 61 74 20 69 74 | 20 77 69 6c 6c 20 62 65 | that it| will be|
|00001dc0| 20 75 73 65 66 75 6c 2c | 0a 20 2a 20 20 62 75 74 | useful,|. * but|
|00001dd0| 20 57 49 54 48 4f 55 54 | 20 41 4e 59 20 57 41 52 | WITHOUT| ANY WAR|
|00001de0| 52 41 4e 54 59 3b 20 77 | 69 74 68 6f 75 74 20 65 |RANTY; w|ithout e|
|00001df0| 76 65 6e 20 74 68 65 20 | 69 6d 70 6c 69 65 64 20 |ven the |implied |
|00001e00| 77 61 72 72 61 6e 74 79 | 20 6f 66 0a 20 2a 20 20 |warranty| of. * |
|00001e10| 4d 45 52 43 48 41 4e 54 | 41 42 49 4c 49 54 59 20 |MERCHANT|ABILITY |
|00001e20| 6f 72 20 46 49 54 4e 45 | 53 53 20 46 4f 52 20 41 |or FITNE|SS FOR A|
|00001e30| 20 50 41 52 54 49 43 55 | 4c 41 52 20 50 55 52 50 | PARTICU|LAR PURP|
|00001e40| 4f 53 45 2e 20 20 53 65 | 65 20 74 68 65 0a 20 2a |OSE. Se|e the. *|
|00001e50| 20 20 47 4e 55 20 47 65 | 6e 65 72 61 6c 20 50 75 | GNU Ge|neral Pu|
|00001e60| 62 6c 69 63 20 4c 69 63 | 65 6e 73 65 20 66 6f 72 |blic Lic|ense for|
|00001e70| 20 6d 6f 72 65 20 64 65 | 74 61 69 6c 73 2e 0a 20 | more de|tails.. |
|00001e80| 2a 0a 20 2a 20 20 59 6f | 75 20 73 68 6f 75 6c 64 |*. * Yo|u should|
|00001e90| 20 68 61 76 65 20 72 65 | 63 65 69 76 65 64 20 61 | have re|ceived a|
|00001ea0| 20 63 6f 70 79 20 6f 66 | 20 74 68 65 20 47 4e 55 | copy of| the GNU|
|00001eb0| 20 47 65 6e 65 72 61 6c | 20 50 75 62 6c 69 63 20 | General| Public |
|00001ec0| 4c 69 63 65 6e 73 65 0a | 20 2a 20 20 61 6c 6f 6e |License.| * alon|
|00001ed0| 67 20 77 69 74 68 20 74 | 68 69 73 20 70 72 6f 67 |g with t|his prog|
|00001ee0| 72 61 6d 3b 20 69 66 20 | 6e 6f 74 2c 20 77 72 69 |ram; if |not, wri|
|00001ef0| 74 65 20 74 6f 20 74 68 | 65 20 46 72 65 65 20 53 |te to th|e Free S|
|00001f00| 6f 66 74 77 61 72 65 0a | 20 2a 20 20 46 6f 75 6e |oftware.| * Foun|
|00001f10| 64 61 74 69 6f 6e 2c 20 | 49 6e 63 2e 2c 20 36 37 |dation, |Inc., 67|
|00001f20| 35 20 4d 61 73 73 20 41 | 76 65 2c 20 43 61 6d 62 |5 Mass A|ve, Camb|
|00001f30| 72 69 64 67 65 2c 20 4d | 41 20 30 32 31 33 39 2c |ridge, M|A 02139,|
|00001f40| 20 55 53 41 2e 0a 20 2a | 0a 20 2a 20 20 49 66 20 | USA.. *|. * If |
|00001f50| 79 6f 75 20 6d 61 6b 65 | 20 6d 6f 64 69 66 69 63 |you make| modific|
|00001f60| 61 74 69 6f 6e 73 20 74 | 6f 20 74 68 65 20 73 6f |ations t|o the so|
|00001f70| 75 72 63 65 2c 20 49 20 | 77 6f 75 6c 64 20 62 65 |urce, I |would be|
|00001f80| 20 68 61 70 70 79 20 74 | 6f 20 68 61 76 65 0a 20 | happy t|o have. |
|00001f90| 2a 20 20 74 68 65 6d 20 | 74 6f 20 69 6e 63 6c 75 |* them |to inclu|
|00001fa0| 64 65 20 69 6e 20 66 75 | 74 75 72 65 20 72 65 6c |de in fu|ture rel|
|00001fb0| 65 61 73 65 73 2e 20 20 | 46 65 65 6c 20 66 72 65 |eases. |Feel fre|
|00001fc0| 65 20 74 6f 20 73 65 6e | 64 20 74 68 65 6d 20 74 |e to sen|d them t|
|00001fd0| 6f 3a 0a 20 2a 20 20 20 | 20 41 64 61 6d 20 4d 69 |o:. * | Adam Mi|
|00001fe0| 67 75 73 09 20 20 20 20 | 20 20 09 09 09 09 0a 20 |gus. | ..... |
|00001ff0| 2a 09 20 20 61 6d 69 67 | 75 73 40 63 73 2e 6d 75 |*. amig|us@cs.mu|
|00002000| 6e 2e 63 61 20 0a 20 2a | 20 20 20 20 61 6d 69 67 |n.ca . *| amig|
|00002010| 75 73 40 75 63 73 2e 6d | 75 6e 2e 63 61 20 20 20 |us@ucs.m|un.ca |
|00002020| 0a 20 2a 0a 20 2a 09 4f | 72 69 67 69 6e 61 6c 20 |. *. *.O|riginal |
|00002030| 53 75 6e 20 76 65 72 73 | 69 6f 6e 20 62 79 3a 0a |Sun vers|ion by:.|
|00002040| 20 2a 20 43 6f 70 79 72 | 69 67 68 74 20 28 63 29 | * Copyr|ight (c)|
|00002050| 20 31 39 38 34 20 62 79 | 20 53 75 6e 20 4d 69 63 | 1984 by| Sun Mic|
|00002060| 72 6f 73 79 73 74 65 6d | 73 2c 20 49 6e 63 2e 0a |rosystem|s, Inc..|
|00002070| 20 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a | *******|********|
|00002080| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00002090| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000020a0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|000020b0| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2f 0a 0a 23 69 |********|***/..#i|
|000020c0| 6e 63 6c 75 64 65 20 3c | 73 74 64 69 6f 2e 68 3e |nclude <|stdio.h>|
|000020d0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 64 6c 69 |.#includ|e <stdli|
|000020e0| 62 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 20 3c 73 |b.h>.#in|clude <s|
|000020f0| 74 72 69 6e 67 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |tring.h>|.#includ|
|00002100| 65 20 3c 73 69 67 6e 61 | 6c 2e 68 3e 0a 23 69 6e |e <signa|l.h>.#in|
|00002110| 63 6c 75 64 65 20 3c 66 | 63 6e 74 6c 2e 68 3e 0a |clude <f|cntl.h>.|
|00002120| 23 69 6e 63 6c 75 64 65 | 20 3c 6c 69 6d 69 74 73 |#include| <limits|
|00002130| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 72 70 |.h>.#inc|lude <rp|
|00002140| 63 2f 72 70 63 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |c/rpc.h>|.#includ|
|00002150| 65 20 3c 73 79 73 2f 73 | 6f 63 6b 65 74 2e 68 3e |e <sys/s|ocket.h>|
|00002160| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 6e 6c 69 73 74 |.#includ|e <nlist|
|00002170| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 79 |.h>.#inc|lude <sy|
|00002180| 73 6c 6f 67 2e 68 3e 0a | 23 69 6e 63 6c 75 64 65 |slog.h>.|#include|
|00002190| 20 3c 73 79 73 2f 65 72 | 72 6e 6f 2e 68 3e 0a 23 | <sys/er|rno.h>.#|
|000021a0| 69 6e 63 6c 75 64 65 20 | 3c 73 79 73 2f 70 61 72 |include |<sys/par|
|000021b0| 61 6d 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |am.h>.#i|nclude <|
|000021c0| 6e 65 74 2f 69 66 2e 68 | 3e 0a 23 69 6e 63 6c 75 |net/if.h|>.#inclu|
|000021d0| 64 65 20 3c 75 74 6d 70 | 2e 68 3e 0a 23 69 6e 63 |de <utmp|.h>.#inc|
|000021e0| 6c 75 64 65 20 22 72 73 | 74 61 74 2e 68 22 0a 0a |lude "rs|tat.h"..|
|000021f0| 23 64 65 66 69 6e 65 20 | 4c 4f 41 44 41 56 47 20 |#define |LOADAVG |
|00002200| 22 2f 70 72 6f 63 2f 6c | 6f 61 64 61 76 67 22 0a |"/proc/l|oadavg".|
|00002210| 23 64 65 66 69 6e 65 20 | 53 54 41 54 20 22 2f 70 |#define |STAT "/p|
|00002220| 72 6f 63 2f 73 74 61 74 | 22 0a 23 64 65 66 69 6e |roc/stat|".#defin|
|00002230| 65 20 55 50 54 49 4d 45 | 20 22 2f 70 72 6f 63 2f |e UPTIME| "/proc/|
|00002240| 75 70 74 69 6d 65 22 0a | 23 64 65 66 69 6e 65 20 |uptime".|#define |
|00002250| 4e 45 54 53 54 55 46 46 | 20 22 2f 70 72 6f 63 2f |NETSTUFF| "/proc/|
|00002260| 6e 65 74 2f 64 65 76 22 | 0a 23 69 66 6e 64 65 66 |net/dev"|.#ifndef|
|00002270| 20 4e 45 54 5f 49 46 41 | 43 45 0a 23 64 65 66 69 | NET_IFA|CE.#defi|
|00002280| 6e 65 20 4e 45 54 5f 49 | 46 41 43 45 20 22 65 74 |ne NET_I|FACE "et|
|00002290| 68 30 22 0a 23 65 6e 64 | 69 66 0a 23 69 66 6e 64 |h0".#end|if.#ifnd|
|000022a0| 65 66 20 5f 50 41 54 48 | 5f 55 54 4d 50 0a 23 64 |ef _PATH|_UTMP.#d|
|000022b0| 65 66 69 6e 65 20 5f 50 | 41 54 48 5f 55 54 4d 50 |efine _P|ATH_UTMP|
|000022c0| 20 22 2f 76 61 72 2f 61 | 64 6d 2f 75 74 6d 70 22 | "/var/a|dm/utmp"|
|000022d0| 0a 23 65 6e 64 69 66 0a | 0a 2f 2a 20 4d 75 73 74 |.#endif.|./* Must|
|000022e0| 20 62 65 20 72 65 64 65 | 66 69 6e 65 64 20 69 66 | be rede|fined if|
|000022f0| 20 75 73 69 6e 67 20 6c | 69 62 63 27 73 20 72 70 | using l|ibc's rp|
|00002300| 63 20 66 75 6e 63 74 69 | 6f 6e 73 20 2a 2f 0a 2f |c functi|ons */./|
|00002310| 2a 20 6c 69 62 63 27 73 | 20 72 70 63 20 69 73 20 |* libc's| rpc is |
|00002320| 72 65 63 6f 6d 6d 65 6e | 64 65 64 20 64 65 73 70 |recommen|ded desp|
|00002330| 69 74 65 20 63 6f 6d 70 | 69 6c 61 74 69 6f 6e 20 |ite comp|ilation |
|00002340| 65 72 72 6f 72 73 20 2a | 2f 0a 23 69 66 64 65 66 |errors *|/.#ifdef|
|00002350| 20 4e 4f 52 50 43 4c 49 | 42 20 0a 23 64 65 66 69 | NORPCLI|B .#defi|
|00002360| 6e 65 20 72 73 74 61 74 | 70 72 6f 63 5f 73 74 61 |ne rstat|proc_sta|
|00002370| 74 73 5f 35 20 72 73 74 | 61 74 70 72 6f 63 5f 73 |ts_5 rst|atproc_s|
|00002380| 74 61 74 73 35 5f 73 76 | 63 0a 23 64 65 66 69 6e |tats5_sv|c.#defin|
|00002390| 65 20 72 73 74 61 74 70 | 72 6f 63 5f 73 74 61 74 |e rstatp|roc_stat|
|000023a0| 73 5f 33 20 72 73 74 61 | 74 70 72 6f 63 5f 73 74 |s_3 rsta|tproc_st|
|000023b0| 61 74 73 33 5f 73 76 63 | 0a 23 64 65 66 69 6e 65 |ats3_svc|.#define|
|000023c0| 20 72 73 74 61 74 70 72 | 6f 63 5f 73 74 61 74 73 | rstatpr|oc_stats|
|000023d0| 5f 32 20 72 73 74 61 74 | 70 72 6f 63 5f 73 74 61 |_2 rstat|proc_sta|
|000023e0| 74 73 32 5f 73 76 63 0a | 23 64 65 66 69 6e 65 20 |ts2_svc.|#define |
|000023f0| 72 73 74 61 74 70 72 6f | 63 5f 73 74 61 74 73 5f |rstatpro|c_stats_|
|00002400| 31 20 72 73 74 61 74 70 | 72 6f 63 5f 73 74 61 74 |1 rstatp|roc_stat|
|00002410| 73 31 5f 73 76 63 0a 23 | 64 65 66 69 6e 65 20 72 |s1_svc.#|define r|
|00002420| 73 74 61 74 70 72 6f 63 | 5f 68 61 76 65 64 69 73 |statproc|_havedis|
|00002430| 6b 5f 35 20 72 73 74 61 | 74 70 72 6f 63 5f 68 61 |k_5 rsta|tproc_ha|
|00002440| 76 65 64 69 73 6b 5f 35 | 5f 73 76 63 0a 23 64 65 |vedisk_5|_svc.#de|
|00002450| 66 69 6e 65 20 72 73 74 | 61 74 70 72 6f 63 5f 68 |fine rst|atproc_h|
|00002460| 61 76 65 64 69 73 6b 5f | 33 20 72 73 74 61 74 70 |avedisk_|3 rstatp|
|00002470| 72 6f 63 5f 68 61 76 65 | 64 69 73 6b 5f 33 5f 73 |roc_have|disk_3_s|
|00002480| 76 63 0a 23 64 65 66 69 | 6e 65 20 72 73 74 61 74 |vc.#defi|ne rstat|
|00002490| 70 72 6f 63 5f 68 61 76 | 65 64 69 73 6b 5f 32 20 |proc_hav|edisk_2 |
|000024a0| 72 73 74 61 74 70 72 6f | 63 5f 68 61 76 65 64 69 |rstatpro|c_havedi|
|000024b0| 73 6b 5f 32 5f 73 76 63 | 0a 23 64 65 66 69 6e 65 |sk_2_svc|.#define|
|000024c0| 20 72 73 74 61 74 70 72 | 6f 63 5f 68 61 76 65 64 | rstatpr|oc_haved|
|000024d0| 69 73 6b 5f 31 20 72 73 | 74 61 74 70 72 6f 63 5f |isk_1 rs|tatproc_|
|000024e0| 68 61 76 65 64 69 73 6b | 5f 31 5f 73 76 63 0a 23 |havedisk|_1_svc.#|
|000024f0| 65 6e 64 69 66 0a 0a 69 | 6e 74 20 73 74 61 74 73 |endif..i|nt stats|
|00002500| 5f 73 65 72 76 69 63 65 | 28 29 3b 0a 73 74 61 74 |_service|();.stat|
|00002510| 69 63 20 76 6f 69 64 20 | 67 65 74 5f 73 74 61 74 |ic void |get_stat|
|00002520| 73 28 29 3b 0a 0a 75 6e | 69 6f 6e 20 7b 0a 09 73 |s();..un|ion {..s|
|00002530| 74 72 75 63 74 20 73 74 | 61 74 73 20 73 31 3b 0a |truct st|ats s1;.|
|00002540| 09 73 74 72 75 63 74 20 | 73 74 61 74 73 73 77 74 |.struct |statsswt|
|00002550| 63 68 20 73 32 3b 0a 09 | 73 74 72 75 63 74 20 73 |ch s2;..|struct s|
|00002560| 74 61 74 73 74 69 6d 65 | 20 73 33 3b 0a 09 73 74 |tatstime| s3;..st|
|00002570| 72 75 63 74 20 73 74 61 | 74 73 75 73 65 72 73 20 |ruct sta|tsusers |
|00002580| 73 35 3b 0a 7d 20 73 74 | 61 74 73 5f 61 6c 6c 3b |s5;.} st|ats_all;|
|00002590| 0a 0a 65 78 74 65 72 6e | 20 69 6e 74 20 69 6e 65 |..extern| int ine|
|000025a0| 74 64 5f 63 6f 6e 6e 65 | 63 74 3b 0a 0a 76 6f 69 |td_conne|ct;..voi|
|000025b0| 64 20 74 65 73 74 5f 63 | 6f 6e 6e 65 63 74 28 29 |d test_c|onnect()|
|000025c0| 0a 7b 0a 09 69 66 28 69 | 6e 65 74 64 5f 63 6f 6e |.{..if(i|netd_con|
|000025d0| 6e 65 63 74 20 21 3d 20 | 30 29 20 7b 0a 09 09 65 |nect != |0) {...e|
|000025e0| 78 69 74 28 30 29 3b 0a | 09 7d 0a 7d 0a 0a 73 74 |xit(0);.|.}.}..st|
|000025f0| 61 74 73 75 73 65 72 73 | 20 2a 72 73 74 61 74 70 |atsusers| *rstatp|
|00002600| 72 6f 63 5f 73 74 61 74 | 73 5f 35 28 61 72 67 2c |roc_stat|s_5(arg,|
|00002610| 20 72 71 73 74 70 29 0a | 76 6f 69 64 20 2a 61 72 | rqstp).|void *ar|
|00002620| 67 3b 0a 73 74 72 75 63 | 74 20 73 76 63 5f 72 65 |g;.struc|t svc_re|
|00002630| 71 20 2a 72 71 73 74 70 | 3b 0a 7b 0a 09 67 65 74 |q *rqstp|;.{..get|
|00002640| 5f 73 74 61 74 73 28 29 | 3b 0a 09 72 65 74 75 72 |_stats()|;..retur|
|00002650| 6e 20 26 73 74 61 74 73 | 5f 61 6c 6c 2e 73 35 3b |n &stats|_all.s5;|
|00002660| 0a 7d 0a 0a 73 74 61 74 | 73 74 69 6d 65 20 2a 72 |.}..stat|stime *r|
|00002670| 73 74 61 74 70 72 6f 63 | 5f 73 74 61 74 73 5f 33 |statproc|_stats_3|
|00002680| 28 61 72 67 2c 20 72 71 | 73 74 70 29 0a 09 76 6f |(arg, rq|stp)..vo|
|00002690| 69 64 20 2a 61 72 67 3b | 0a 09 73 74 72 75 63 74 |id *arg;|..struct|
|000026a0| 20 73 76 63 5f 72 65 71 | 20 2a 72 71 73 74 70 3b | svc_req| *rqstp;|
|000026b0| 0a 7b 0a 09 67 65 74 5f | 73 74 61 74 73 28 29 3b |.{..get_|stats();|
|000026c0| 0a 09 72 65 74 75 72 6e | 20 26 73 74 61 74 73 5f |..return| &stats_|
|000026d0| 61 6c 6c 2e 73 33 3b 0a | 7d 0a 0a 73 74 61 74 73 |all.s3;.|}..stats|
|000026e0| 73 77 74 63 68 20 2a 72 | 73 74 61 74 70 72 6f 63 |swtch *r|statproc|
|000026f0| 5f 73 74 61 74 73 5f 32 | 28 61 72 67 2c 20 72 71 |_stats_2|(arg, rq|
|00002700| 73 74 70 29 0a 09 76 6f | 69 64 20 2a 61 72 67 3b |stp)..vo|id *arg;|
|00002710| 0a 09 73 74 72 75 63 74 | 20 73 76 63 5f 72 65 71 |..struct| svc_req|
|00002720| 20 2a 72 71 73 74 70 3b | 0a 7b 0a 09 67 65 74 5f | *rqstp;|.{..get_|
|00002730| 73 74 61 74 73 28 29 3b | 0a 09 72 65 74 75 72 6e |stats();|..return|
|00002740| 20 28 26 73 74 61 74 73 | 5f 61 6c 6c 2e 73 32 29 | (&stats|_all.s2)|
|00002750| 3b 0a 7d 0a 0a 73 74 61 | 74 73 20 2a 72 73 74 61 |;.}..sta|ts *rsta|
|00002760| 74 70 72 6f 63 5f 73 74 | 61 74 73 5f 31 28 61 72 |tproc_st|ats_1(ar|
|00002770| 67 2c 20 72 71 73 74 70 | 29 0a 09 76 6f 69 64 20 |g, rqstp|)..void |
|00002780| 2a 61 72 67 3b 0a 09 73 | 74 72 75 63 74 20 73 76 |*arg;..s|truct sv|
|00002790| 63 5f 72 65 71 20 2a 72 | 71 73 74 70 3b 0a 7b 0a |c_req *r|qstp;.{.|
|000027a0| 09 67 65 74 5f 73 74 61 | 74 73 28 29 3b 0a 09 72 |.get_sta|ts();..r|
|000027b0| 65 74 75 72 6e 20 28 26 | 73 74 61 74 73 5f 61 6c |eturn (&|stats_al|
|000027c0| 6c 2e 73 31 29 3b 0a 7d | 0a 0a 75 5f 69 6e 74 20 |l.s1);.}|..u_int |
|000027d0| 2a 72 73 74 61 74 70 72 | 6f 63 5f 68 61 76 65 64 |*rstatpr|oc_haved|
|000027e0| 69 73 6b 5f 35 28 61 72 | 67 2c 20 72 71 73 74 70 |isk_5(ar|g, rqstp|
|000027f0| 29 0a 09 76 6f 69 64 20 | 2a 61 72 67 3b 0a 09 73 |)..void |*arg;..s|
|00002800| 74 72 75 63 74 20 73 76 | 63 5f 72 65 71 20 2a 72 |truct sv|c_req *r|
|00002810| 71 73 74 70 3b 0a 7b 0a | 09 73 74 61 74 69 63 20 |qstp;.{.|.static |
|00002820| 75 5f 69 6e 74 20 68 61 | 76 65 3b 0a 0a 09 67 65 |u_int ha|ve;...ge|
|00002830| 74 5f 73 74 61 74 73 28 | 29 3b 0a 09 68 61 76 65 |t_stats(|);..have|
|00002840| 20 3d 20 68 61 76 65 64 | 69 73 6b 28 29 3b 0a 09 | = haved|isk();..|
|00002850| 72 65 74 75 72 6e 20 28 | 26 68 61 76 65 29 3b 0a |return (|&have);.|
|00002860| 7d 0a 0a 75 5f 69 6e 74 | 20 2a 72 73 74 61 74 70 |}..u_int| *rstatp|
|00002870| 72 6f 63 5f 68 61 76 65 | 64 69 73 6b 5f 33 28 61 |roc_have|disk_3(a|
|00002880| 72 67 2c 20 72 71 73 74 | 70 29 0a 09 76 6f 69 64 |rg, rqst|p)..void|
|00002890| 20 2a 61 72 67 3b 0a 09 | 73 74 72 75 63 74 20 73 | *arg;..|struct s|
|000028a0| 76 63 5f 72 65 71 20 2a | 72 71 73 74 70 3b 0a 7b |vc_req *|rqstp;.{|
|000028b0| 0a 09 72 65 74 75 72 6e | 20 28 72 73 74 61 74 70 |..return| (rstatp|
|000028c0| 72 6f 63 5f 68 61 76 65 | 64 69 73 6b 5f 35 28 61 |roc_have|disk_5(a|
|000028d0| 72 67 2c 20 72 71 73 74 | 70 29 29 3b 0a 7d 0a 0a |rg, rqst|p));.}..|
|000028e0| 75 5f 69 6e 74 20 2a 72 | 73 74 61 74 70 72 6f 63 |u_int *r|statproc|
|000028f0| 5f 68 61 76 65 64 69 73 | 6b 5f 32 28 61 72 67 2c |_havedis|k_2(arg,|
|00002900| 20 72 71 73 74 70 29 0a | 09 76 6f 69 64 20 2a 61 | rqstp).|.void *a|
|00002910| 72 67 3b 0a 09 73 74 72 | 75 63 74 20 73 76 63 5f |rg;..str|uct svc_|
|00002920| 72 65 71 20 2a 72 71 73 | 74 70 3b 0a 7b 0a 09 72 |req *rqs|tp;.{..r|
|00002930| 65 74 75 72 6e 20 28 72 | 73 74 61 74 70 72 6f 63 |eturn (r|statproc|
|00002940| 5f 68 61 76 65 64 69 73 | 6b 5f 35 28 61 72 67 2c |_havedis|k_5(arg,|
|00002950| 20 72 71 73 74 70 29 29 | 3b 0a 7d 0a 0a 75 5f 69 | rqstp))|;.}..u_i|
|00002960| 6e 74 20 2a 72 73 74 61 | 74 70 72 6f 63 5f 68 61 |nt *rsta|tproc_ha|
|00002970| 76 65 64 69 73 6b 5f 31 | 28 61 72 67 2c 20 72 71 |vedisk_1|(arg, rq|
|00002980| 73 74 70 29 0a 09 76 6f | 69 64 20 2a 61 72 67 3b |stp)..vo|id *arg;|
|00002990| 0a 09 73 74 72 75 63 74 | 20 73 76 63 5f 72 65 71 |..struct| svc_req|
|000029a0| 20 2a 72 71 73 74 70 3b | 0a 7b 0a 09 72 65 74 75 | *rqstp;|.{..retu|
|000029b0| 72 6e 20 28 72 73 74 61 | 74 70 72 6f 63 5f 68 61 |rn (rsta|tproc_ha|
|000029c0| 76 65 64 69 73 6b 5f 35 | 28 61 72 67 2c 20 72 71 |vedisk_5|(arg, rq|
|000029d0| 73 74 70 29 29 3b 0a 7d | 0a 0a 73 74 61 74 69 63 |stp));.}|..static|
|000029e0| 20 76 6f 69 64 20 67 65 | 74 5f 73 74 61 74 73 28 | void ge|t_stats(|
|000029f0| 29 0a 7b 0a 09 64 6f 75 | 62 6c 65 20 61 76 72 75 |).{..dou|ble avru|
|00002a00| 6e 5b 33 5d 3b 0a 09 46 | 49 4c 45 20 2a 66 73 74 |n[3];..F|ILE *fst|
|00002a10| 2c 20 2a 66 6c 61 2c 20 | 2a 66 6e 65 74 3b 0a 09 |, *fla, |*fnet;..|
|00002a20| 69 6e 74 20 72 65 73 75 | 6c 74 3d 36 3b 0a 09 63 |int resu|lt=6;..c|
|00002a30| 68 61 72 20 69 66 61 63 | 65 5b 38 5d 3d 22 22 2c |har ifac|e[8]="",|
|00002a40| 74 65 6d 70 5b 32 35 36 | 5d 3b 0a 0a 09 69 66 28 |temp[256|];...if(|
|00002a50| 28 66 73 74 20 3d 20 66 | 6f 70 65 6e 28 53 54 41 |(fst = f|open(STA|
|00002a60| 54 2c 20 22 72 22 29 29 | 20 3d 3d 20 4e 55 4c 4c |T, "r"))| == NULL|
|00002a70| 29 20 7b 0a 09 09 73 79 | 73 6c 6f 67 28 4c 4f 47 |) {...sy|slog(LOG|
|00002a80| 5f 45 52 52 2c 20 22 63 | 61 6e 27 74 20 6f 70 65 |_ERR, "c|an't ope|
|00002a90| 6e 20 2f 70 72 6f 63 2f | 73 74 61 74 22 29 3b 0a |n /proc/|stat");.|
|00002aa0| 09 7d 0a 0a 09 66 73 63 | 61 6e 66 28 66 73 74 2c |.}...fsc|anf(fst,|
|00002ab0| 20 22 63 70 75 20 20 25 | 75 20 25 75 20 25 75 20 | "cpu %|u %u %u |
|00002ac0| 25 75 5c 6e 22 2c 26 73 | 74 61 74 73 5f 61 6c 6c |%u\n",&s|tats_all|
|00002ad0| 2e 73 31 2e 63 70 5f 74 | 69 6d 65 5b 30 5d 2c 0a |.s1.cp_t|ime[0],.|
|00002ae0| 09 09 09 09 26 73 74 61 | 74 73 5f 61 6c 6c 2e 73 |....&sta|ts_all.s|
|00002af0| 31 2e 63 70 5f 74 69 6d | 65 5b 31 5d 2c 26 73 74 |1.cp_tim|e[1],&st|
|00002b00| 61 74 73 5f 61 6c 6c 2e | 73 31 2e 63 70 5f 74 69 |ats_all.|s1.cp_ti|
|00002b10| 6d 65 5b 32 5d 2c 0a 09 | 09 09 09 26 73 74 61 74 |me[2],..|...&stat|
|00002b20| 73 5f 61 6c 6c 2e 73 31 | 2e 63 70 5f 74 69 6d 65 |s_all.s1|.cp_time|
|00002b30| 5b 33 5d 29 3b 0a 0a 09 | 69 66 28 28 66 6c 61 20 |[3]);...|if((fla |
|00002b40| 3d 20 66 6f 70 65 6e 28 | 4c 4f 41 44 41 56 47 2c |= fopen(|LOADAVG,|
|00002b50| 20 22 72 22 29 29 20 3d | 3d 20 4e 55 4c 4c 29 20 | "r")) =|= NULL) |
|00002b60| 7b 0a 09 09 73 79 73 6c | 6f 67 28 4c 4f 47 5f 45 |{...sysl|og(LOG_E|
|00002b70| 52 52 2c 20 22 63 61 6e | 27 74 20 6f 70 65 6e 20 |RR, "can|'t open |
|00002b80| 2f 70 72 6f 63 2f 6c 6f | 61 64 61 76 67 22 29 3b |/proc/lo|adavg");|
|00002b90| 0a 09 7d 0a 09 66 73 63 | 61 6e 66 28 66 6c 61 2c |..}..fsc|anf(fla,|
|00002ba0| 20 22 25 6c 66 20 25 6c | 66 20 25 6c 66 22 2c 20 | "%lf %l|f %lf", |
|00002bb0| 26 61 76 72 75 6e 5b 30 | 5d 2c 20 26 61 76 72 75 |&avrun[0|], &avru|
|00002bc0| 6e 5b 31 5d 2c 20 26 61 | 76 72 75 6e 5b 32 5d 29 |n[1], &a|vrun[2])|
|00002bd0| 3b 0a 09 73 74 61 74 73 | 5f 61 6c 6c 2e 73 32 2e |;..stats|_all.s2.|
|00002be0| 61 76 65 6e 72 75 6e 5b | 30 5d 20 3d 20 61 76 72 |avenrun[|0] = avr|
|00002bf0| 75 6e 5b 30 5d 20 2a 20 | 46 53 43 41 4c 45 3b 0a |un[0] * |FSCALE;.|
|00002c00| 09 73 74 61 74 73 5f 61 | 6c 6c 2e 73 32 2e 61 76 |.stats_a|ll.s2.av|
|00002c10| 65 6e 72 75 6e 5b 31 5d | 20 3d 20 61 76 72 75 6e |enrun[1]| = avrun|
|00002c20| 5b 31 5d 20 2a 20 46 53 | 43 41 4c 45 3b 0a 09 73 |[1] * FS|CALE;..s|
|00002c30| 74 61 74 73 5f 61 6c 6c | 2e 73 32 2e 61 76 65 6e |tats_all|.s2.aven|
|00002c40| 72 75 6e 5b 32 5d 20 3d | 20 61 76 72 75 6e 5b 32 |run[2] =| avrun[2|
|00002c50| 5d 20 2a 20 46 53 43 41 | 4c 45 3b 0a 0a 09 66 73 |] * FSCA|LE;...fs|
|00002c60| 63 61 6e 66 28 66 73 74 | 2c 20 22 64 69 73 6b 20 |canf(fst|, "disk |
|00002c70| 25 75 20 25 75 20 25 75 | 20 25 75 5c 6e 22 2c 26 |%u %u %u| %u\n",&|
|00002c80| 73 74 61 74 73 5f 61 6c | 6c 2e 73 31 2e 64 6b 5f |stats_al|l.s1.dk_|
|00002c90| 78 66 65 72 5b 30 5d 2c | 0a 09 09 09 26 73 74 61 |xfer[0],|....&sta|
|00002ca0| 74 73 5f 61 6c 6c 2e 73 | 31 2e 64 6b 5f 78 66 65 |ts_all.s|1.dk_xfe|
|00002cb0| 72 5b 31 5d 2c 26 73 74 | 61 74 73 5f 61 6c 6c 2e |r[1],&st|ats_all.|
|00002cc0| 73 31 2e 64 6b 5f 78 66 | 65 72 5b 32 5d 2c 0a 09 |s1.dk_xf|er[2],..|
|00002cd0| 09 09 26 73 74 61 74 73 | 5f 61 6c 6c 2e 73 31 2e |..&stats|_all.s1.|
|00002ce0| 64 6b 5f 78 66 65 72 5b | 33 5d 29 3b 0a 0a 09 66 |dk_xfer[|3]);...f|
|00002cf0| 73 63 61 6e 66 28 66 73 | 74 2c 20 22 70 61 67 65 |scanf(fs|t, "page|
|00002d00| 20 25 75 20 25 75 5c 6e | 22 2c 20 26 73 74 61 74 | %u %u\n|", &stat|
|00002d10| 73 5f 61 6c 6c 2e 73 31 | 2e 76 5f 70 67 70 67 69 |s_all.s1|.v_pgpgi|
|00002d20| 6e 2c 20 26 73 74 61 74 | 73 5f 61 6c 6c 2e 73 31 |n, &stat|s_all.s1|
|00002d30| 2e 76 5f 70 67 70 67 6f | 75 74 29 3b 0a 09 66 73 |.v_pgpgo|ut);..fs|
|00002d40| 63 61 6e 66 28 66 73 74 | 2c 20 22 73 77 61 70 20 |canf(fst|, "swap |
|00002d50| 25 75 20 25 75 5c 6e 22 | 2c 20 26 73 74 61 74 73 |%u %u\n"|, &stats|
|00002d60| 5f 61 6c 6c 2e 73 31 2e | 76 5f 70 73 77 70 69 6e |_all.s1.|v_pswpin|
|00002d70| 2c 20 26 73 74 61 74 73 | 5f 61 6c 6c 2e 73 31 2e |, &stats|_all.s1.|
|00002d80| 76 5f 70 73 77 70 6f 75 | 74 29 3b 0a 0a 09 66 73 |v_pswpou|t);...fs|
|00002d90| 63 61 6e 66 28 66 73 74 | 2c 20 22 69 6e 74 72 20 |canf(fst|, "intr |
|00002da0| 25 75 20 25 2a 75 20 25 | 2a 75 20 25 2a 75 20 25 |%u %*u %|*u %*u %|
|00002db0| 2a 75 20 25 2a 75 20 25 | 2a 75 20 25 2a 75 20 25 |*u %*u %|*u %*u %|
|00002dc0| 2a 75 20 25 2a 75 20 25 | 2a 75 20 25 2a 75 20 25 |*u %*u %|*u %*u %|
|00002dd0| 2a 75 20 25 2a 75 20 25 | 2a 75 20 25 2a 75 20 25 |*u %*u %|*u %*u %|
|00002de0| 2a 75 5c 6e 22 2c 0a 09 | 09 09 09 20 26 73 74 61 |*u\n",..|... &sta|
|00002df0| 74 73 5f 61 6c 6c 2e 73 | 31 2e 76 5f 69 6e 74 72 |ts_all.s|1.v_intr|
|00002e00| 29 3b 0a 09 66 73 63 61 | 6e 66 28 66 73 74 2c 20 |);..fsca|nf(fst, |
|00002e10| 22 63 74 78 74 20 25 75 | 5c 6e 22 2c 20 26 73 74 |"ctxt %u|\n", &st|
|00002e20| 61 74 73 5f 61 6c 6c 2e | 73 32 2e 76 5f 73 77 74 |ats_all.|s2.v_swt|
|00002e30| 63 68 29 3b 0a 0a 09 69 | 66 20 28 28 66 6e 65 74 |ch);...i|f ((fnet|
|00002e40| 20 3d 20 66 6f 70 65 6e | 28 4e 45 54 53 54 55 46 | = fopen|(NETSTUF|
|00002e50| 46 2c 22 72 22 29 29 20 | 3d 3d 20 4e 55 4c 4c 29 |F,"r")) |== NULL)|
|00002e60| 20 7b 0a 09 09 73 79 73 | 6c 6f 67 28 4c 4f 47 5f | {...sys|log(LOG_|
|00002e70| 45 52 52 2c 22 63 61 6e | 27 74 20 6f 70 65 6e 20 |ERR,"can|'t open |
|00002e80| 2f 70 72 6f 63 2f 6e 65 | 74 2f 64 65 76 22 29 3b |/proc/ne|t/dev");|
|00002e90| 0a 09 7d 0a 0a 09 66 67 | 65 74 73 28 74 65 6d 70 |..}...fg|ets(temp|
|00002ea0| 2c 32 35 36 2c 66 6e 65 | 74 29 3b 20 2f 2a 20 68 |,256,fne|t); /* h|
|00002eb0| 65 61 64 65 72 20 69 6e | 20 2f 70 72 6f 63 2f 64 |eader in| /proc/d|
|00002ec0| 65 76 2f 6e 65 74 20 2a | 2f 0a 09 66 67 65 74 73 |ev/net *|/..fgets|
|00002ed0| 28 74 65 6d 70 2c 32 35 | 36 2c 66 6e 65 74 29 3b |(temp,25|6,fnet);|
|00002ee0| 20 2f 2a 20 73 65 63 6f | 6e 64 20 68 65 61 64 65 | /* seco|nd heade|
|00002ef0| 72 20 69 6e 20 2f 70 72 | 6f 63 2f 64 65 76 2f 6e |r in /pr|oc/dev/n|
|00002f00| 65 74 20 2a 2f 0a 0a 09 | 77 68 69 6c 65 28 21 73 |et */...|while(!s|
|00002f10| 74 72 73 74 72 28 28 63 | 68 61 72 20 2a 29 26 69 |trstr((c|har *)&i|
|00002f20| 66 61 63 65 2c 4e 45 54 | 5f 49 46 41 43 45 29 20 |face,NET|_IFACE) |
|00002f30| 26 26 20 28 72 65 73 75 | 6c 74 20 21 3d 20 45 4f |&& (resu|lt != EO|
|00002f40| 46 29 20 29 20 7b 0a 09 | 09 72 65 73 75 6c 74 20 |F) ) {..|.result |
|00002f50| 3d 20 66 73 63 61 6e 66 | 28 66 6e 65 74 2c 20 22 |= fscanf|(fnet, "|
|00002f60| 20 25 73 20 25 75 20 25 | 75 20 25 2a 75 20 25 2a | %s %u %|u %*u %*|
|00002f70| 75 20 25 2a 75 20 25 75 | 20 25 75 20 25 2a 75 20 |u %*u %u| %u %*u |
|00002f80| 25 2a 75 20 25 75 20 25 | 2a 75 5c 6e 22 2c 0a 09 |%*u %u %|*u\n",..|
|00002f90| 09 09 26 69 66 61 63 65 | 2c 20 26 73 74 61 74 73 |..&iface|, &stats|
|00002fa0| 5f 61 6c 6c 2e 73 31 2e | 69 66 5f 69 70 61 63 6b |_all.s1.|if_ipack|
|00002fb0| 65 74 73 2c 20 26 73 74 | 61 74 73 5f 61 6c 6c 2e |ets, &st|ats_all.|
|00002fc0| 73 31 2e 69 66 5f 69 65 | 72 72 6f 72 73 2c 20 0a |s1.if_ie|rrors, .|
|00002fd0| 09 09 09 26 73 74 61 74 | 73 5f 61 6c 6c 2e 73 33 |...&stat|s_all.s3|
|00002fe0| 2e 69 66 5f 6f 70 61 63 | 6b 65 74 73 2c 20 26 73 |.if_opac|kets, &s|
|00002ff0| 74 61 74 73 5f 61 6c 6c | 2e 73 31 2e 69 66 5f 6f |tats_all|.s1.if_o|
|00003000| 65 72 72 6f 72 73 2c 0a | 09 09 09 26 73 74 61 74 |errors,.|...&stat|
|00003010| 73 5f 61 6c 6c 2e 73 31 | 2e 69 66 5f 63 6f 6c 6c |s_all.s1|.if_coll|
|00003020| 69 73 69 6f 6e 73 29 3b | 0a 09 09 69 66 20 28 72 |isions);|...if (r|
|00003030| 65 73 75 6c 74 20 21 3d | 20 36 29 20 2f 2a 20 22 |esult !=| 6) /* "|
|00003040| 4e 6f 20 73 74 61 74 69 | 73 74 69 63 73 20 61 76 |No stati|stics av|
|00003050| 61 69 6c 61 62 6c 65 22 | 20 6f 72 20 45 4f 46 20 |ailable"| or EOF |
|00003060| 72 65 61 63 68 65 64 20 | 2a 2f 0a 09 09 09 73 74 |reached |*/....st|
|00003070| 61 74 73 5f 61 6c 6c 2e | 73 31 2e 69 66 5f 69 70 |ats_all.|s1.if_ip|
|00003080| 61 63 6b 65 74 73 20 3d | 20 73 74 61 74 73 5f 61 |ackets =| stats_a|
|00003090| 6c 6c 2e 73 31 2e 69 66 | 5f 69 65 72 72 6f 72 73 |ll.s1.if|_ierrors|
|000030a0| 20 3d 20 0a 09 09 09 09 | 73 74 61 74 73 5f 61 6c | = .....|stats_al|
|000030b0| 6c 2e 73 33 2e 69 66 5f | 6f 70 61 63 6b 65 74 73 |l.s3.if_|opackets|
|000030c0| 20 3d 0a 09 09 09 09 73 | 74 61 74 73 5f 61 6c 6c | =.....s|tats_all|
|000030d0| 2e 73 31 2e 69 66 5f 6f | 65 72 72 6f 72 73 20 3d |.s1.if_o|errors =|
|000030e0| 20 0a 09 09 09 09 73 74 | 61 74 73 5f 61 6c 6c 2e | .....st|ats_all.|
|000030f0| 73 31 2e 69 66 5f 63 6f | 6c 6c 69 73 69 6f 6e 73 |s1.if_co|llisions|
|00003100| 20 3d 20 30 3b 0a 09 7d | 0a 0a 09 66 63 6c 6f 73 | = 0;..}|...fclos|
|00003110| 65 28 66 73 74 29 3b 0a | 09 66 63 6c 6f 73 65 28 |e(fst);.|.fclose(|
|00003120| 66 6c 61 29 3b 0a 09 66 | 63 6c 6f 73 65 28 66 6e |fla);..f|close(fn|
|00003130| 65 74 29 3b 0a 0a 09 73 | 74 61 74 73 5f 61 6c 6c |et);...s|tats_all|
|00003140| 2e 73 35 2e 75 73 65 72 | 73 20 3d 20 6c 5f 75 73 |.s5.user|s = l_us|
|00003150| 65 72 73 28 29 3b 0a 0a | 09 67 65 74 74 69 6d 65 |ers();..|.gettime|
|00003160| 6f 66 64 61 79 28 28 73 | 74 72 75 63 74 20 74 69 |ofday((s|truct ti|
|00003170| 6d 65 76 61 6c 20 2a 29 | 0a 09 09 09 09 26 73 74 |meval *)|.....&st|
|00003180| 61 74 73 5f 61 6c 6c 2e | 73 33 2e 63 75 72 74 69 |ats_all.|s3.curti|
|00003190| 6d 65 2c 28 73 74 72 75 | 63 74 20 74 69 6d 65 7a |me,(stru|ct timez|
|000031a0| 6f 6e 65 20 2a 29 20 30 | 29 3b 0a 09 73 74 61 74 |one *) 0|);..stat|
|000031b0| 73 5f 61 6c 6c 2e 73 32 | 2e 62 6f 6f 74 74 69 6d |s_all.s2|.boottim|
|000031c0| 65 2e 74 76 5f 73 65 63 | 20 3d 20 28 73 74 61 74 |e.tv_sec| = (stat|
|000031d0| 73 5f 61 6c 6c 2e 73 33 | 2e 63 75 72 74 69 6d 65 |s_all.s3|.curtime|
|000031e0| 2e 74 76 5f 73 65 63 20 | 2d 20 6c 5f 75 70 74 69 |.tv_sec |- l_upti|
|000031f0| 6d 65 28 29 29 3b 0a 09 | 69 66 28 69 6e 65 74 64 |me());..|if(inetd|
|00003200| 5f 63 6f 6e 6e 65 63 74 | 29 20 61 6c 61 72 6d 28 |_connect|) alarm(|
|00003210| 31 29 3b 20 0a 7d 0a 0a | 69 6e 74 20 68 61 76 65 |1); .}..|int have|
|00003220| 64 69 73 6b 28 29 0a 7b | 0a 0a 09 69 6e 74 20 69 |disk().{|...int i|
|00003230| 2c 20 63 6e 74 3b 0a 09 | 6c 6f 6e 67 20 20 78 66 |, cnt;..|long xf|
|00003240| 65 72 5b 44 4b 5f 4e 44 | 52 49 56 45 5d 3b 0a 0a |er[DK_ND|RIVE];..|
|00003250| 09 63 6e 74 20 3d 20 30 | 3b 0a 09 66 6f 72 20 28 |.cnt = 0|;..for (|
|00003260| 69 3d 30 3b 20 69 20 3c | 20 44 4b 5f 4e 44 52 49 |i=0; i <| DK_NDRI|
|00003270| 56 45 3b 20 69 2b 2b 29 | 0a 09 09 63 6e 74 20 2b |VE; i++)|...cnt +|
|00003280| 3d 20 78 66 65 72 5b 69 | 5d 3b 0a 09 72 65 74 75 |= xfer[i|];..retu|
|00003290| 72 6e 20 28 63 6e 74 20 | 21 3d 20 30 29 3b 0a 7d |rn (cnt |!= 0);.}|
|000032a0| 0a 0a 69 6e 74 20 6c 5f | 75 70 74 69 6d 65 28 29 |..int l_|uptime()|
|000032b0| 0a 7b 0a 09 69 6e 74 20 | 66 64 3b 0a 09 64 6f 75 |.{..int |fd;..dou|
|000032c0| 62 6c 65 20 75 70 5f 73 | 65 63 73 2c 20 69 64 6c |ble up_s|ecs, idl|
|000032d0| 65 5f 73 65 63 73 3b 0a | 09 63 68 61 72 20 62 75 |e_secs;.|.char bu|
|000032e0| 66 5b 42 55 46 53 49 5a | 5d 3b 0a 0a 09 69 66 28 |f[BUFSIZ|];...if(|
|000032f0| 28 66 64 20 3d 20 6f 70 | 65 6e 28 55 50 54 49 4d |(fd = op|en(UPTIM|
|00003300| 45 2c 4f 5f 52 44 4f 4e | 4c 59 29 29 20 3c 20 30 |E,O_RDON|LY)) < 0|
|00003310| 29 20 7b 0a 09 09 72 65 | 74 75 72 6e 3b 0a 09 7d |) {...re|turn;..}|
|00003320| 0a 09 69 66 28 28 72 65 | 61 64 28 66 64 2c 28 63 |..if((re|ad(fd,(c|
|00003330| 68 61 72 20 2a 29 26 62 | 75 66 2c 73 69 7a 65 6f |har *)&b|uf,sizeo|
|00003340| 66 28 62 75 66 29 29 29 | 20 3c 20 30 29 20 7b 0a |f(buf)))| < 0) {.|
|00003350| 09 09 72 65 74 75 72 6e | 3b 0a 09 7d 0a 09 28 76 |..return|;..}..(v|
|00003360| 6f 69 64 29 63 6c 6f 73 | 65 28 66 64 29 3b 0a 09 |oid)clos|e(fd);..|
|00003370| 69 66 28 73 73 63 61 6e | 66 28 62 75 66 2c 22 25 |if(sscan|f(buf,"%|
|00003380| 6c 66 20 25 6c 66 22 2c | 26 75 70 5f 73 65 63 73 |lf %lf",|&up_secs|
|00003390| 2c 26 69 64 6c 65 5f 73 | 65 63 73 29 20 3c 20 32 |,&idle_s|ecs) < 2|
|000033a0| 29 20 7b 0a 09 09 72 65 | 74 75 72 6e 3b 0a 09 7d |) {...re|turn;..}|
|000033b0| 0a 09 72 65 74 75 72 6e | 28 28 75 6e 73 69 67 6e |..return|((unsign|
|000033c0| 65 64 20 69 6e 74 29 75 | 70 5f 73 65 63 73 29 3b |ed int)u|p_secs);|
|000033d0| 0a 7d 0a 0a 69 6e 74 20 | 6c 5f 75 73 65 72 73 28 |.}..int |l_users(|
|000033e0| 29 0a 7b 0a 09 69 6e 74 | 20 75 66 64 2c 20 75 73 |).{..int| ufd, us|
|000033f0| 65 72 73 20 3d 20 30 3b | 0a 09 73 74 61 74 69 63 |ers = 0;|..static|
|00003400| 20 63 68 61 72 20 62 75 | 66 5b 33 5d 3b 0a 20 20 | char bu|f[3];. |
|00003410| 20 20 73 74 72 75 63 74 | 20 75 74 6d 70 20 75 3b | struct| utmp u;|
|00003420| 0a 0a 20 20 20 20 69 66 | 20 28 28 75 66 64 20 3d |.. if| ((ufd =|
|00003430| 20 6f 70 65 6e 28 5f 50 | 41 54 48 5f 55 54 4d 50 | open(_P|ATH_UTMP|
|00003440| 2c 20 4f 5f 52 44 4f 4e | 4c 59 29 29 20 3c 20 30 |, O_RDON|LY)) < 0|
|00003450| 29 20 7b 0a 09 09 72 65 | 74 75 72 6e 3b 0a 09 7d |) {...re|turn;..}|
|00003460| 0a 20 20 20 20 77 68 69 | 6c 65 20 28 72 65 61 64 |. whi|le (read|
|00003470| 28 75 66 64 2c 20 28 63 | 68 61 72 20 2a 29 20 26 |(ufd, (c|har *) &|
|00003480| 75 2c 20 73 69 7a 65 6f | 66 28 75 29 29 20 3d 3d |u, sizeo|f(u)) ==|
|00003490| 20 73 69 7a 65 6f 66 28 | 75 29 29 20 7b 0a 20 20 | sizeof(|u)) {. |
|000034a0| 20 20 20 20 20 20 69 66 | 28 75 2e 75 74 5f 74 79 | if|(u.ut_ty|
|000034b0| 70 65 3d 3d 37 20 26 26 | 20 75 2e 75 74 5f 6e 61 |pe==7 &&| u.ut_na|
|000034c0| 6d 65 5b 30 5d 20 21 3d | 20 27 5c 30 27 29 20 7b |me[0] !=| '\0') {|
|000034d0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 75 73 65 |. | use|
|000034e0| 72 73 2b 2b 3b 0a 20 20 | 20 20 20 20 20 20 7d 0a |rs++;. | }.|
|000034f0| 20 20 20 20 7d 0a 09 28 | 76 6f 69 64 29 63 6c 6f | }..(|void)clo|
|00003500| 73 65 28 75 66 64 29 3b | 0a 09 73 70 72 69 6e 74 |se(ufd);|..sprint|
|00003510| 66 28 62 75 66 2c 22 25 | 69 22 2c 75 73 65 72 73 |f(buf,"%|i",users|
|00003520| 29 3b 0a 09 72 65 74 75 | 72 6e 28 75 73 65 72 73 |);..retu|rn(users|
|00003530| 29 3b 0a 7d 0a 0a 76 6f | 69 64 20 72 73 74 61 74 |);.}..vo|id rstat|
|00003540| 5f 73 65 72 76 69 63 65 | 28 72 71 73 74 70 2c 20 |_service|(rqstp, |
|00003550| 74 72 61 6e 73 70 29 0a | 09 73 74 72 75 63 74 20 |transp).|.struct |
|00003560| 73 76 63 5f 72 65 71 20 | 2a 72 71 73 74 70 3b 0a |svc_req |*rqstp;.|
|00003570| 09 53 56 43 58 50 52 54 | 20 2a 74 72 61 6e 73 70 |.SVCXPRT| *transp|
|00003580| 3b 0a 7b 0a 09 75 6e 69 | 6f 6e 20 7b 0a 09 09 69 |;.{..uni|on {...i|
|00003590| 6e 74 20 66 69 6c 6c 3b | 0a 09 7d 20 61 72 67 75 |nt fill;|..} argu|
|000035a0| 6d 65 6e 74 3b 0a 09 63 | 68 61 72 20 2a 72 65 73 |ment;..c|har *res|
|000035b0| 75 6c 74 3b 0a 09 78 64 | 72 70 72 6f 63 5f 74 20 |ult;..xd|rproc_t |
|000035c0| 78 64 72 5f 61 72 67 75 | 6d 65 6e 74 2c 20 78 64 |xdr_argu|ment, xd|
|000035d0| 72 5f 72 65 73 75 6c 74 | 3b 0a 09 63 68 61 72 20 |r_result|;..char |
|000035e0| 2a 28 2a 6c 6f 63 61 6c | 29 20 5f 5f 50 28 28 76 |*(*local|) __P((v|
|000035f0| 6f 69 64 20 2a 2c 20 73 | 74 72 75 63 74 20 73 76 |oid *, s|truct sv|
|00003600| 63 5f 72 65 71 20 2a 29 | 29 3b 0a 09 76 6f 69 64 |c_req *)|);..void|
|00003610| 20 2a 76 3b 0a 0a 09 73 | 77 69 74 63 68 20 28 72 | *v;...s|witch (r|
|00003620| 71 73 74 70 2d 3e 72 71 | 5f 70 72 6f 63 29 20 7b |qstp->rq|_proc) {|
|00003630| 0a 09 63 61 73 65 20 4e | 55 4c 4c 50 52 4f 43 3a |..case N|ULLPROC:|
|00003640| 0a 09 09 28 76 6f 69 64 | 29 73 76 63 5f 73 65 6e |...(void|)svc_sen|
|00003650| 64 72 65 70 6c 79 28 74 | 72 61 6e 73 70 2c 20 28 |dreply(t|ransp, (|
|00003660| 78 64 72 70 72 6f 63 5f | 74 29 20 78 64 72 5f 76 |xdrproc_|t) xdr_v|
|00003670| 6f 69 64 2c 20 28 63 68 | 61 72 20 2a 29 4e 55 4c |oid, (ch|ar *)NUL|
|00003680| 4c 29 3b 0a 20 20 20 20 | 20 20 69 66 28 69 6e 65 |L);. | if(ine|
|00003690| 74 64 5f 63 6f 6e 6e 65 | 63 74 29 20 65 78 69 74 |td_conne|ct) exit|
|000036a0| 28 30 29 3b 0a 0a 09 63 | 61 73 65 20 52 53 54 41 |(0);...c|ase RSTA|
|000036b0| 54 50 52 4f 43 5f 53 54 | 41 54 53 3a 0a 09 09 78 |TPROC_ST|ATS:...x|
|000036c0| 64 72 5f 61 72 67 75 6d | 65 6e 74 20 3d 20 28 78 |dr_argum|ent = (x|
|000036d0| 64 72 70 72 6f 63 5f 74 | 29 78 64 72 5f 76 6f 69 |drproc_t|)xdr_voi|
|000036e0| 64 3b 0a 09 09 78 64 72 | 5f 72 65 73 75 6c 74 20 |d;...xdr|_result |
|000036f0| 3d 20 28 78 64 72 70 72 | 6f 63 5f 74 29 78 64 72 |= (xdrpr|oc_t)xdr|
|00003700| 5f 73 74 61 74 73 75 73 | 65 72 73 3b 0a 20 20 20 |_statsus|ers;. |
|00003710| 20 20 20 73 77 69 74 63 | 68 20 28 72 71 73 74 70 | switc|h (rqstp|
|00003720| 2d 3e 72 71 5f 76 65 72 | 73 29 20 7b 0a 20 20 20 |->rq_ver|s) {. |
|00003730| 20 20 20 20 20 20 20 63 | 61 73 65 20 52 53 54 41 | c|ase RSTA|
|00003740| 54 56 45 52 53 5f 4f 52 | 49 47 3a 0a 20 20 20 20 |TVERS_OR|IG:. |
|00003750| 20 20 20 20 20 20 20 20 | 20 20 20 6c 6f 63 61 6c | | local|
|00003760| 20 3d 20 28 63 68 61 72 | 20 2a 28 2a 29 20 5f 5f | = (char| *(*) __|
|00003770| 50 28 28 76 6f 69 64 20 | 2a 2c 20 73 74 72 75 63 |P((void |*, struc|
|00003780| 74 20 73 76 63 5f 72 65 | 71 20 2a 29 29 29 0a 09 |t svc_re|q *)))..|
|00003790| 09 09 09 09 72 73 74 61 | 74 70 72 6f 63 5f 73 74 |....rsta|tproc_st|
|000037a0| 61 74 73 5f 31 3b 0a 20 | 20 20 20 20 20 20 20 20 |ats_1;. | |
|000037b0| 20 20 20 20 20 20 62 72 | 65 61 6b 3b 0a 20 20 20 | br|eak;. |
|000037c0| 20 20 20 20 20 20 20 63 | 61 73 65 20 52 53 54 41 | c|ase RSTA|
|000037d0| 54 56 45 52 53 5f 53 57 | 54 43 48 3a 0a 20 20 20 |TVERS_SW|TCH:. |
|000037e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 6c 6f 63 61 | | loca|
|000037f0| 6c 20 3d 20 28 63 68 61 | 72 20 2a 28 2a 29 20 5f |l = (cha|r *(*) _|
|00003800| 5f 50 28 28 76 6f 69 64 | 20 2a 2c 20 73 74 72 75 |_P((void| *, stru|
|00003810| 63 74 20 73 76 63 5f 72 | 65 71 20 2a 29 29 29 0a |ct svc_r|eq *))).|
|00003820| 09 09 09 09 09 72 73 74 | 61 74 70 72 6f 63 5f 73 |.....rst|atproc_s|
|00003830| 74 61 74 73 5f 32 3b 0a | 20 20 20 20 20 20 20 20 |tats_2;.| |
|00003840| 20 20 20 20 20 20 20 62 | 72 65 61 6b 3b 0a 20 20 | b|reak;. |
|00003850| 20 20 20 20 20 20 20 20 | 63 61 73 65 20 52 53 54 | |case RST|
|00003860| 41 54 56 45 52 53 5f 54 | 49 4d 45 3a 0a 20 20 20 |ATVERS_T|IME:. |
|00003870| 20 20 20 20 20 20 20 20 | 20 20 20 20 6c 6f 63 61 | | loca|
|00003880| 6c 20 3d 20 28 63 68 61 | 72 20 2a 28 2a 29 20 5f |l = (cha|r *(*) _|
|00003890| 5f 50 28 28 76 6f 69 64 | 20 2a 2c 20 73 74 72 75 |_P((void| *, stru|
|000038a0| 63 74 20 73 76 63 5f 72 | 65 71 20 2a 29 29 29 0a |ct svc_r|eq *))).|
|000038b0| 09 09 09 09 09 72 73 74 | 61 74 70 72 6f 63 5f 73 |.....rst|atproc_s|
|000038c0| 74 61 74 73 5f 33 3b 0a | 20 20 20 20 20 20 20 20 |tats_3;.| |
|000038d0| 20 20 20 20 20 20 20 62 | 72 65 61 6b 3b 0a 20 20 | b|reak;. |
|000038e0| 20 20 20 20 20 20 20 20 | 63 61 73 65 20 52 53 54 | |case RST|
|000038f0| 41 54 56 45 52 53 5f 55 | 53 45 52 53 3a 0a 20 20 |ATVERS_U|SERS:. |
|00003900| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 6c 6f 63 | | loc|
|00003910| 61 6c 20 3d 20 28 63 68 | 61 72 20 2a 28 2a 29 20 |al = (ch|ar *(*) |
|00003920| 5f 5f 50 28 28 76 6f 69 | 64 20 2a 2c 20 73 74 72 |__P((voi|d *, str|
|00003930| 75 63 74 20 73 76 63 5f | 72 65 71 20 2a 29 29 29 |uct svc_|req *)))|
|00003940| 0a 09 09 09 09 09 72 73 | 74 61 74 70 72 6f 63 5f |......rs|tatproc_|
|00003950| 73 74 61 74 73 5f 35 3b | 0a 20 20 20 20 20 20 20 |stats_5;|. |
|00003960| 20 20 20 20 20 20 20 20 | 62 72 65 61 6b 3b 0a 20 | |break;. |
|00003970| 20 20 20 20 20 20 20 20 | 20 64 65 66 61 75 6c 74 | | default|
|00003980| 3a 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |:. | |
|00003990| 20 73 76 63 65 72 72 5f | 70 72 6f 67 76 65 72 73 | svcerr_|progvers|
|000039a0| 28 74 72 61 6e 73 70 2c | 20 52 53 54 41 54 56 45 |(transp,| RSTATVE|
|000039b0| 52 53 5f 4f 52 49 47 2c | 20 52 53 54 41 54 56 45 |RS_ORIG,| RSTATVE|
|000039c0| 52 53 5f 55 53 45 52 53 | 29 3b 0a 20 20 20 20 20 |RS_USERS|);. |
|000039d0| 20 20 20 20 20 20 20 20 | 20 20 69 66 28 69 6e 65 | | if(ine|
|000039e0| 74 64 5f 63 6f 6e 6e 65 | 63 74 29 20 65 78 69 74 |td_conne|ct) exit|
|000039f0| 28 30 29 3b 0a 20 20 20 | 20 20 20 7d 0a 09 09 62 |(0);. | }...b|
|00003a00| 72 65 61 6b 3b 0a 0a 09 | 63 61 73 65 20 52 53 54 |reak;...|case RST|
|00003a10| 41 54 50 52 4f 43 5f 48 | 41 56 45 44 49 53 4b 3a |ATPROC_H|AVEDISK:|
|00003a20| 0a 09 09 78 64 72 5f 61 | 72 67 75 6d 65 6e 74 20 |...xdr_a|rgument |
|00003a30| 3d 20 28 78 64 72 70 72 | 6f 63 5f 74 29 78 64 72 |= (xdrpr|oc_t)xdr|
|00003a40| 5f 76 6f 69 64 3b 0a 09 | 09 78 64 72 5f 72 65 73 |_void;..|.xdr_res|
|00003a50| 75 6c 74 20 3d 20 28 78 | 64 72 70 72 6f 63 5f 74 |ult = (x|drproc_t|
|00003a60| 29 78 64 72 5f 75 5f 69 | 6e 74 3b 0a 20 20 20 20 |)xdr_u_i|nt;. |
|00003a70| 20 20 73 77 69 74 63 68 | 20 28 72 71 73 74 70 2d | switch| (rqstp-|
|00003a80| 3e 72 71 5f 76 65 72 73 | 29 20 7b 0a 20 20 20 20 |>rq_vers|) {. |
|00003a90| 20 20 20 20 20 20 63 61 | 73 65 20 52 53 54 41 54 | ca|se RSTAT|
|00003aa0| 56 45 52 53 5f 4f 52 49 | 47 3a 0a 20 20 20 20 20 |VERS_ORI|G:. |
|00003ab0| 20 20 20 20 20 20 20 20 | 20 20 6c 6f 63 61 6c 20 | | local |
|00003ac0| 3d 20 28 63 68 61 72 20 | 2a 28 2a 29 20 5f 5f 50 |= (char |*(*) __P|
|00003ad0| 28 28 76 6f 69 64 20 2a | 2c 20 73 74 72 75 63 74 |((void *|, struct|
|00003ae0| 20 73 76 63 5f 72 65 71 | 20 2a 29 29 29 0a 09 09 | svc_req| *)))...|
|00003af0| 09 09 09 72 73 74 61 74 | 70 72 6f 63 5f 68 61 76 |...rstat|proc_hav|
|00003b00| 65 64 69 73 6b 5f 31 3b | 0a 20 20 20 20 20 20 20 |edisk_1;|. |
|00003b10| 20 20 20 20 20 20 20 20 | 62 72 65 61 6b 3b 0a 20 | |break;. |
|00003b20| 20 20 20 20 20 20 20 20 | 20 63 61 73 65 20 52 53 | | case RS|
|00003b30| 54 41 54 56 45 52 53 5f | 53 57 54 43 48 3a 0a 20 |TATVERS_|SWTCH:. |
|00003b40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 6c 6f | | lo|
|00003b50| 63 61 6c 20 3d 20 28 63 | 68 61 72 20 2a 28 2a 29 |cal = (c|har *(*)|
|00003b60| 20 5f 5f 50 28 28 76 6f | 69 64 20 2a 2c 20 73 74 | __P((vo|id *, st|
|00003b70| 72 75 63 74 20 73 76 63 | 5f 72 65 71 20 2a 29 29 |ruct svc|_req *))|
|00003b80| 29 0a 09 09 09 09 09 72 | 73 74 61 74 70 72 6f 63 |)......r|statproc|
|00003b90| 5f 68 61 76 65 64 69 73 | 6b 5f 32 3b 0a 20 20 20 |_havedis|k_2;. |
|00003ba0| 20 20 20 20 20 20 20 20 | 20 20 20 20 62 72 65 61 | | brea|
|00003bb0| 6b 3b 0a 20 20 20 20 20 | 20 20 20 20 20 63 61 73 |k;. | cas|
|00003bc0| 65 20 52 53 54 41 54 56 | 45 52 53 5f 54 49 4d 45 |e RSTATV|ERS_TIME|
|00003bd0| 3a 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |:. | |
|00003be0| 20 6c 6f 63 61 6c 20 3d | 20 28 63 68 61 72 20 2a | local =| (char *|
|00003bf0| 28 2a 29 20 5f 5f 50 28 | 28 76 6f 69 64 20 2a 2c |(*) __P(|(void *,|
|00003c00| 20 73 74 72 75 63 74 20 | 73 76 63 5f 72 65 71 20 | struct |svc_req |
|00003c10| 2a 29 29 29 0a 09 09 09 | 09 09 72 73 74 61 74 70 |*)))....|..rstatp|
|00003c20| 72 6f 63 5f 68 61 76 65 | 64 69 73 6b 5f 33 3b 0a |roc_have|disk_3;.|
|00003c30| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 62 | | b|
|00003c40| 72 65 61 6b 3b 0a 20 20 | 20 20 20 20 20 20 20 20 |reak;. | |
|00003c50| 63 61 73 65 20 52 53 54 | 41 54 56 45 52 53 5f 55 |case RST|ATVERS_U|
|00003c60| 53 45 52 53 3a 0a 20 20 | 20 20 20 20 20 20 20 20 |SERS:. | |
|00003c70| 20 20 20 20 20 6c 6f 63 | 61 6c 20 3d 20 28 63 68 | loc|al = (ch|
|00003c80| 61 72 20 2a 28 2a 29 20 | 5f 5f 50 28 28 76 6f 69 |ar *(*) |__P((voi|
|00003c90| 64 20 2a 2c 20 73 74 72 | 75 63 74 20 73 76 63 5f |d *, str|uct svc_|
|00003ca0| 72 65 71 20 2a 29 29 29 | 0a 09 09 09 09 09 72 73 |req *)))|......rs|
|00003cb0| 74 61 74 70 72 6f 63 5f | 68 61 76 65 64 69 73 6b |tatproc_|havedisk|
|00003cc0| 5f 35 3b 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |_5;. | |
|00003cd0| 20 20 20 62 72 65 61 6b | 3b 0a 20 20 20 20 20 20 | break|;. |
|00003ce0| 20 20 20 20 64 65 66 61 | 75 6c 74 3a 0a 20 20 20 | defa|ult:. |
|00003cf0| 20 20 20 20 20 20 20 20 | 20 20 20 20 73 76 63 65 | | svce|
|00003d00| 72 72 5f 70 72 6f 67 76 | 65 72 73 28 74 72 61 6e |rr_progv|ers(tran|
|00003d10| 73 70 2c 20 52 53 54 41 | 54 56 45 52 53 5f 4f 52 |sp, RSTA|TVERS_OR|
|00003d20| 49 47 2c 20 52 53 54 41 | 54 56 45 52 53 5f 55 53 |IG, RSTA|TVERS_US|
|00003d30| 45 52 53 29 3b 0a 20 20 | 20 20 20 20 20 20 20 20 |ERS);. | |
|00003d40| 20 20 20 20 20 69 66 28 | 69 6e 65 74 64 5f 63 6f | if(|inetd_co|
|00003d50| 6e 6e 65 63 74 29 20 65 | 78 69 74 28 30 29 3b 0a |nnect) e|xit(0);.|
|00003d60| 20 20 20 20 20 20 7d 0a | 09 09 62 72 65 61 6b 3b | }.|..break;|
|00003d70| 0a 09 64 65 66 61 75 6c | 74 3a 0a 09 09 73 76 63 |..defaul|t:...svc|
|00003d80| 65 72 72 5f 6e 6f 70 72 | 6f 63 28 74 72 61 6e 73 |err_nopr|oc(trans|
|00003d90| 70 29 3b 0a 20 20 20 20 | 20 20 69 66 28 69 6e 65 |p);. | if(ine|
|00003da0| 74 64 5f 63 6f 6e 6e 65 | 63 74 29 20 65 78 69 74 |td_conne|ct) exit|
|00003db0| 28 30 29 3b 0a 09 7d 0a | 09 62 7a 65 72 6f 28 28 |(0);..}.|.bzero((|
|00003dc0| 63 68 61 72 20 2a 29 26 | 61 72 67 75 6d 65 6e 74 |char *)&|argument|
|00003dd0| 2c 20 73 69 7a 65 6f 66 | 28 61 72 67 75 6d 65 6e |, sizeof|(argumen|
|00003de0| 74 29 29 3b 0a 09 69 66 | 20 28 21 73 76 63 5f 67 |t));..if| (!svc_g|
|00003df0| 65 74 61 72 67 73 28 74 | 72 61 6e 73 70 2c 20 78 |etargs(t|ransp, x|
|00003e00| 64 72 5f 61 72 67 75 6d | 65 6e 74 2c 20 28 63 61 |dr_argum|ent, (ca|
|00003e10| 64 64 72 5f 74 29 26 61 | 72 67 75 6d 65 6e 74 29 |ddr_t)&a|rgument)|
|00003e20| 29 20 7b 0a 09 09 73 76 | 63 65 72 72 5f 64 65 63 |) {...sv|cerr_dec|
|00003e30| 6f 64 65 28 74 72 61 6e | 73 70 29 3b 0a 20 20 20 |ode(tran|sp);. |
|00003e40| 20 20 20 69 66 28 69 6e | 65 74 64 5f 63 6f 6e 6e | if(in|etd_conn|
|00003e50| 65 63 74 29 20 65 78 69 | 74 28 30 29 3b 0a 09 7d |ect) exi|t(0);..}|
|00003e60| 0a 09 72 65 73 75 6c 74 | 20 3d 20 28 2a 6c 6f 63 |..result| = (*loc|
|00003e70| 61 6c 29 28 26 61 72 67 | 75 6d 65 6e 74 2c 20 72 |al)(&arg|ument, r|
|00003e80| 71 73 74 70 29 3b 0a 09 | 69 66 20 28 72 65 73 75 |qstp);..|if (resu|
|00003e90| 6c 74 20 21 3d 20 4e 55 | 4c 4c 20 26 26 20 21 73 |lt != NU|LL && !s|
|00003ea0| 76 63 5f 73 65 6e 64 72 | 65 70 6c 79 28 74 72 61 |vc_sendr|eply(tra|
|00003eb0| 6e 73 70 2c 20 78 64 72 | 5f 72 65 73 75 6c 74 2c |nsp, xdr|_result,|
|00003ec0| 20 72 65 73 75 6c 74 29 | 29 20 7b 0a 09 09 73 76 | result)|) {...sv|
|00003ed0| 63 65 72 72 5f 73 79 73 | 74 65 6d 65 72 72 28 74 |cerr_sys|temerr(t|
|00003ee0| 72 61 6e 73 70 29 3b 0a | 09 7d 0a 09 69 66 20 28 |ransp);.|.}..if (|
|00003ef0| 21 73 76 63 5f 66 72 65 | 65 61 72 67 73 28 74 72 |!svc_fre|eargs(tr|
|00003f00| 61 6e 73 70 2c 20 78 64 | 72 5f 61 72 67 75 6d 65 |ansp, xd|r_argume|
|00003f10| 6e 74 2c 20 28 63 61 64 | 64 72 5f 74 29 26 61 72 |nt, (cad|dr_t)&ar|
|00003f20| 67 75 6d 65 6e 74 29 29 | 20 7b 0a 09 09 28 76 6f |gument))| {...(vo|
|00003f30| 69 64 29 66 70 72 69 6e | 74 66 28 73 74 64 65 72 |id)fprin|tf(stder|
|00003f40| 72 2c 20 22 75 6e 61 62 | 6c 65 20 74 6f 20 66 72 |r, "unab|le to fr|
|00003f50| 65 65 20 61 72 67 75 6d | 65 6e 74 73 5c 6e 22 29 |ee argum|ents\n")|
|00003f60| 3b 0a 09 09 65 78 69 74 | 28 31 29 3b 0a 09 7d 0a |;...exit|(1);..}.|
|00003f70| 7d 0a 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |}.......|........|
|00003f80| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003f90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fa0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fb0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003fe0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00003ff0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004000| 72 70 63 2e 72 73 74 61 | 74 64 2d 33 2e 30 33 2f |rpc.rsta|td-3.03/|
|00004010| 72 75 70 2e 63 00 00 00 | 00 00 00 00 00 00 00 00 |rup.c...|........|
|00004020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004060| 00 00 00 00 31 30 30 36 | 34 34 20 00 20 20 20 20 |....1006|44 . |
|00004070| 20 30 20 00 20 20 20 20 | 20 30 20 00 20 20 20 20 | 0 . | 0 . |
|00004080| 20 20 32 30 36 34 37 20 | 20 36 31 30 34 30 34 33 | 20647 | 6104043|
|00004090| 36 35 32 20 20 31 32 36 | 30 35 00 20 30 00 00 00 |652 126|05. 0...|
|000040a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004100| 00 75 73 74 61 72 20 20 | 00 72 6f 6f 74 00 00 00 |.ustar |.root...|
|00004110| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004120| 00 00 00 00 00 00 00 00 | 00 72 6f 6f 74 00 00 00 |........|.root...|
|00004130| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004140| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004150| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004160| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004170| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004180| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004190| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041a0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000041f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004200| 2f 2a 0a 20 2a 20 20 72 | 75 70 20 76 65 72 73 69 |/*. * r|up versi|
|00004210| 6f 6e 20 33 2e 30 33 20 | 72 70 63 20 72 75 70 74 |on 3.03 |rpc rupt|
|00004220| 69 6d 65 20 63 6c 69 65 | 6e 74 20 66 6f 72 20 75 |ime clie|nt for u|
|00004230| 73 65 20 77 69 74 68 20 | 72 70 63 2e 72 73 74 61 |se with |rpc.rsta|
|00004240| 74 64 20 33 2e 30 33 0a | 20 2a 20 20 43 6f 70 79 |td 3.03.| * Copy|
|00004250| 72 69 67 68 74 20 28 43 | 29 20 31 39 39 35 20 20 |right (C|) 1995 |
|00004260| 41 64 61 6d 20 4d 69 67 | 75 73 2c 20 4d 65 6d 6f |Adam Mig|us, Memo|
|00004270| 72 69 61 6c 20 55 6e 69 | 76 65 72 73 69 74 79 20 |rial Uni|versity |
|00004280| 6f 66 20 4e 65 77 66 6f | 75 6e 64 6c 61 6e 64 0a |of Newfo|undland.|
|00004290| 20 2a 09 28 4d 55 4e 29 | 0a 20 2a 0a 20 2a 20 20 | *.(MUN)|. *. * |
|000042a0| 54 68 69 73 20 70 72 6f | 67 72 61 6d 20 69 73 20 |This pro|gram is |
|000042b0| 66 72 65 65 20 73 6f 66 | 74 77 61 72 65 3b 20 79 |free sof|tware; y|
|000042c0| 6f 75 20 63 61 6e 20 72 | 65 64 69 73 74 72 69 62 |ou can r|edistrib|
|000042d0| 75 74 65 20 69 74 20 61 | 6e 64 2f 6f 72 20 6d 6f |ute it a|nd/or mo|
|000042e0| 64 69 66 79 0a 20 2a 20 | 20 69 74 20 75 6e 64 65 |dify. * | it unde|
|000042f0| 72 20 74 68 65 20 74 65 | 72 6d 73 20 6f 66 20 74 |r the te|rms of t|
|00004300| 68 65 20 47 4e 55 20 47 | 65 6e 65 72 61 6c 20 50 |he GNU G|eneral P|
|00004310| 75 62 6c 69 63 20 4c 69 | 63 65 6e 73 65 20 61 73 |ublic Li|cense as|
|00004320| 20 70 75 62 6c 69 73 68 | 65 64 20 62 79 0a 20 2a | publish|ed by. *|
|00004330| 20 20 74 68 65 20 46 72 | 65 65 20 53 6f 66 74 77 | the Fr|ee Softw|
|00004340| 61 72 65 20 46 6f 75 6e | 64 61 74 69 6f 6e 3b 20 |are Foun|dation; |
|00004350| 65 69 74 68 65 72 20 76 | 65 72 73 69 6f 6e 20 31 |either v|ersion 1|
|00004360| 2c 20 6f 72 20 28 61 74 | 20 79 6f 75 72 20 6f 70 |, or (at| your op|
|00004370| 74 69 6f 6e 29 0a 20 2a | 20 20 61 6e 79 20 6c 61 |tion). *| any la|
|00004380| 74 65 72 20 76 65 72 73 | 69 6f 6e 2e 0a 20 2a 0a |ter vers|ion.. *.|
|00004390| 20 2a 20 20 54 68 69 73 | 20 70 72 6f 67 72 61 6d | * This| program|
|000043a0| 20 69 73 20 64 69 73 74 | 72 69 62 75 74 65 64 20 | is dist|ributed |
|000043b0| 69 6e 20 74 68 65 20 68 | 6f 70 65 20 74 68 61 74 |in the h|ope that|
|000043c0| 20 69 74 20 77 69 6c 6c | 20 62 65 20 75 73 65 66 | it will| be usef|
|000043d0| 75 6c 2c 0a 20 2a 20 20 | 62 75 74 20 57 49 54 48 |ul,. * |but WITH|
|000043e0| 4f 55 54 20 41 4e 59 20 | 57 41 52 52 41 4e 54 59 |OUT ANY |WARRANTY|
|000043f0| 3b 20 77 69 74 68 6f 75 | 74 20 65 76 65 6e 20 74 |; withou|t even t|
|00004400| 68 65 20 69 6d 70 6c 69 | 65 64 20 77 61 72 72 61 |he impli|ed warra|
|00004410| 6e 74 79 20 6f 66 0a 20 | 2a 20 20 4d 45 52 43 48 |nty of. |* MERCH|
|00004420| 41 4e 54 41 42 49 4c 49 | 54 59 20 6f 72 20 46 49 |ANTABILI|TY or FI|
|00004430| 54 4e 45 53 53 20 46 4f | 52 20 41 20 50 41 52 54 |TNESS FO|R A PART|
|00004440| 49 43 55 4c 41 52 20 50 | 55 52 50 4f 53 45 2e 20 |ICULAR P|URPOSE. |
|00004450| 20 53 65 65 20 74 68 65 | 0a 20 2a 20 20 47 4e 55 | See the|. * GNU|
|00004460| 20 47 65 6e 65 72 61 6c | 20 50 75 62 6c 69 63 20 | General| Public |
|00004470| 4c 69 63 65 6e 73 65 20 | 66 6f 72 20 6d 6f 72 65 |License |for more|
|00004480| 20 64 65 74 61 69 6c 73 | 2e 0a 20 2a 0a 20 2a 20 | details|.. *. * |
|00004490| 20 59 6f 75 20 73 68 6f | 75 6c 64 20 68 61 76 65 | You sho|uld have|
|000044a0| 20 72 65 63 65 69 76 65 | 64 20 61 20 63 6f 70 79 | receive|d a copy|
|000044b0| 20 6f 66 20 74 68 65 20 | 47 4e 55 20 47 65 6e 65 | of the |GNU Gene|
|000044c0| 72 61 6c 20 50 75 62 6c | 69 63 20 4c 69 63 65 6e |ral Publ|ic Licen|
|000044d0| 73 65 0a 20 2a 20 20 61 | 6c 6f 6e 67 20 77 69 74 |se. * a|long wit|
|000044e0| 68 20 74 68 69 73 20 70 | 72 6f 67 72 61 6d 3b 20 |h this p|rogram; |
|000044f0| 69 66 20 6e 6f 74 2c 20 | 77 72 69 74 65 20 74 6f |if not, |write to|
|00004500| 20 74 68 65 20 46 72 65 | 65 20 53 6f 66 74 77 61 | the Fre|e Softwa|
|00004510| 72 65 0a 20 2a 20 20 46 | 6f 75 6e 64 61 74 69 6f |re. * F|oundatio|
|00004520| 6e 2c 20 49 6e 63 2e 2c | 20 36 37 35 20 4d 61 73 |n, Inc.,| 675 Mas|
|00004530| 73 20 41 76 65 2c 20 43 | 61 6d 62 72 69 64 67 65 |s Ave, C|ambridge|
|00004540| 2c 20 4d 41 20 30 32 31 | 33 39 2c 20 55 53 41 2e |, MA 021|39, USA.|
|00004550| 0a 20 2a 0a 20 2a 20 20 | 49 66 20 79 6f 75 20 6d |. *. * |If you m|
|00004560| 61 6b 65 20 6d 6f 64 69 | 66 69 63 61 74 69 6f 6e |ake modi|fication|
|00004570| 73 20 74 6f 20 74 68 65 | 20 73 6f 75 72 63 65 2c |s to the| source,|
|00004580| 20 49 20 77 6f 75 6c 64 | 20 62 65 20 68 61 70 70 | I would| be happ|
|00004590| 79 20 74 6f 20 68 61 76 | 65 0a 20 2a 20 20 74 68 |y to hav|e. * th|
|000045a0| 65 6d 20 74 6f 20 69 6e | 63 6c 75 64 65 20 69 6e |em to in|clude in|
|000045b0| 20 66 75 74 75 72 65 20 | 72 65 6c 65 61 73 65 73 | future |releases|
|000045c0| 2e 20 20 46 65 65 6c 20 | 66 72 65 65 20 74 6f 20 |. Feel |free to |
|000045d0| 73 65 6e 64 20 74 68 65 | 6d 20 74 6f 3a 0a 20 2a |send the|m to:. *|
|000045e0| 20 20 20 20 20 20 41 64 | 61 6d 20 4d 69 67 75 73 | Ad|am Migus|
|000045f0| 09 20 20 20 20 20 20 09 | 09 09 09 0a 20 2a 09 09 |. .|.... *..|
|00004600| 61 6d 69 67 75 73 40 63 | 73 2e 6d 75 6e 2e 63 61 |amigus@c|s.mun.ca|
|00004610| 20 0a 20 2a 20 20 20 20 | 61 6d 69 67 75 73 40 75 | . * |amigus@u|
|00004620| 63 73 2e 6d 75 6e 2e 63 | 61 20 20 20 0a 20 2a 0a |cs.mun.c|a . *.|
|00004630| 20 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a | *******|********|
|00004640| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004650| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004660| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00004670| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2f 0a 0a 23 69 |********|***/..#i|
|00004680| 6e 63 6c 75 64 65 20 3c | 73 74 64 69 6f 2e 68 3e |nclude <|stdio.h>|
|00004690| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 72 70 63 2f 72 |.#includ|e <rpc/r|
|000046a0| 70 63 2e 68 3e 0a 23 69 | 6e 63 6c 75 64 65 20 3c |pc.h>.#i|nclude <|
|000046b0| 72 70 63 2f 63 6c 6e 74 | 2e 68 3e 0a 23 69 6e 63 |rpc/clnt|.h>.#inc|
|000046c0| 6c 75 64 65 20 3c 73 79 | 73 2f 73 6f 63 6b 65 74 |lude <sy|s/socket|
|000046d0| 2e 68 3e 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 79 |.h>.#inc|lude <sy|
|000046e0| 73 2f 74 69 6d 65 2e 68 | 3e 0a 23 69 6e 63 6c 75 |s/time.h|>.#inclu|
|000046f0| 64 65 20 3c 6e 65 74 64 | 62 2e 68 3e 0a 23 69 6e |de <netd|b.h>.#in|
|00004700| 63 6c 75 64 65 20 22 72 | 73 74 61 74 2e 68 22 0a |clude "r|stat.h".|
|00004710| 0a 76 6f 69 64 20 62 7a | 65 72 6f 28 29 3b 0a 76 |.void bz|ero();.v|
|00004720| 6f 69 64 20 62 63 6f 70 | 79 28 29 3b 0a 63 68 61 |oid bcop|y();.cha|
|00004730| 72 20 2a 72 69 6e 64 65 | 78 28 29 3b 0a 0a 63 68 |r *rinde|x();..ch|
|00004740| 61 72 20 2a 76 65 72 73 | 69 6f 6e 20 3d 20 22 40 |ar *vers|ion = "@|
|00004750| 28 23 29 72 75 70 20 76 | 65 72 73 69 6f 6e 20 33 |(#)rup v|ersion 3|
|00004760| 2e 30 33 20 43 6f 70 79 | 72 69 67 68 74 20 28 41 |.03 Copy|right (A|
|00004770| 64 61 6d 20 4d 69 67 75 | 73 29 20 31 2f 39 2f 39 |dam Migu|s) 1/9/9|
|00004780| 36 5c 6e 22 3b 0a 63 68 | 61 72 20 2a 70 72 6f 67 |6\n";.ch|ar *prog|
|00004790| 72 61 6d 5f 6e 61 6d 65 | 3b 0a 0a 73 74 72 75 63 |ram_name|;..struc|
|000047a0| 74 20 68 6f 73 74 5f 74 | 79 70 65 20 7b 0a 09 73 |t host_t|ype {..s|
|000047b0| 74 72 75 63 74 20 69 6e | 5f 61 64 64 72 20 68 6f |truct in|_addr ho|
|000047c0| 73 74 5f 61 64 64 72 3b | 0a 09 73 74 72 75 63 74 |st_addr;|..struct|
|000047d0| 20 68 6f 73 74 5f 74 79 | 70 65 20 2a 6e 65 78 74 | host_ty|pe *next|
|000047e0| 3b 0a 7d 3b 0a 0a 73 74 | 72 75 63 74 20 68 6f 73 |;.};..st|ruct hos|
|000047f0| 74 5f 74 79 70 65 20 2a | 68 6f 73 74 5f 6c 69 73 |t_type *|host_lis|
|00004800| 74 3b 0a 0a 69 6e 74 20 | 73 61 76 65 5f 68 6f 73 |t;..int |save_hos|
|00004810| 74 6e 61 6d 65 28 6e 65 | 77 5f 61 64 64 72 29 0a |tname(ne|w_addr).|
|00004820| 73 74 72 75 63 74 20 69 | 6e 5f 61 64 64 72 20 6e |struct i|n_addr n|
|00004830| 65 77 5f 61 64 64 72 3b | 0a 7b 0a 09 73 74 72 75 |ew_addr;|.{..stru|
|00004840| 63 74 20 68 6f 73 74 5f | 74 79 70 65 20 2a 6e 65 |ct host_|type *ne|
|00004850| 77 5f 69 74 65 6d 3b 0a | 0a 09 69 66 28 21 28 6e |w_item;.|..if(!(n|
|00004860| 65 77 5f 69 74 65 6d 3d | 28 73 74 72 75 63 74 20 |ew_item=|(struct |
|00004870| 68 6f 73 74 5f 74 79 70 | 65 20 2a 29 6d 61 6c 6c |host_typ|e *)mall|
|00004880| 6f 63 28 73 69 7a 65 6f | 66 28 73 74 72 75 63 74 |oc(sizeo|f(struct|
|00004890| 20 68 6f 73 74 5f 74 79 | 70 65 29 29 29 29 20 7b | host_ty|pe)))) {|
|000048a0| 0a 09 09 66 70 72 69 6e | 74 66 28 73 74 64 65 72 |...fprin|tf(stder|
|000048b0| 72 2c 22 25 73 3a 20 6f | 75 74 20 6f 66 20 6d 65 |r,"%s: o|ut of me|
|000048c0| 6d 6f 72 79 2e 2e 2e 5c | 6e 22 2c 70 72 6f 67 72 |mory...\|n",progr|
|000048d0| 61 6d 5f 6e 61 6d 65 29 | 3b 0a 09 09 72 65 74 75 |am_name)|;...retu|
|000048e0| 72 6e 28 30 29 3b 0a 09 | 7d 0a 09 6e 65 77 5f 69 |rn(0);..|}..new_i|
|000048f0| 74 65 6d 2d 3e 68 6f 73 | 74 5f 61 64 64 72 2e 73 |tem->hos|t_addr.s|
|00004900| 5f 61 64 64 72 20 3d 20 | 6e 65 77 5f 61 64 64 72 |_addr = |new_addr|
|00004910| 2e 73 5f 61 64 64 72 3b | 0a 09 6e 65 77 5f 69 74 |.s_addr;|..new_it|
|00004920| 65 6d 2d 3e 6e 65 78 74 | 20 3d 20 68 6f 73 74 5f |em->next| = host_|
|00004930| 6c 69 73 74 3b 0a 09 68 | 6f 73 74 5f 6c 69 73 74 |list;..h|ost_list|
|00004940| 20 3d 20 6e 65 77 5f 69 | 74 65 6d 3b 0a 09 72 65 | = new_i|tem;..re|
|00004950| 74 75 72 6e 28 31 29 3b | 0a 7d 0a 69 6e 74 20 66 |turn(1);|.}.int f|
|00004960| 69 6e 64 5f 68 6f 73 74 | 6e 61 6d 65 28 74 68 65 |ind_host|name(the|
|00004970| 5f 61 64 64 72 29 0a 73 | 74 72 75 63 74 20 69 6e |_addr).s|truct in|
|00004980| 5f 61 64 64 72 20 74 68 | 65 5f 61 64 64 72 3b 0a |_addr th|e_addr;.|
|00004990| 7b 0a 09 73 74 72 75 63 | 74 20 68 6f 73 74 5f 74 |{..struc|t host_t|
|000049a0| 79 70 65 20 2a 63 75 72 | 72 65 6e 74 5f 69 74 65 |ype *cur|rent_ite|
|000049b0| 6d 3b 0a 0a 09 63 75 72 | 72 65 6e 74 5f 69 74 65 |m;...cur|rent_ite|
|000049c0| 6d 20 3d 20 68 6f 73 74 | 5f 6c 69 73 74 3b 0a 09 |m = host|_list;..|
|000049d0| 77 68 69 6c 65 28 63 75 | 72 72 65 6e 74 5f 69 74 |while(cu|rrent_it|
|000049e0| 65 6d 20 21 3d 20 4e 55 | 4c 4c 29 20 7b 0a 09 09 |em != NU|LL) {...|
|000049f0| 69 66 28 63 75 72 72 65 | 6e 74 5f 69 74 65 6d 2d |if(curre|nt_item-|
|00004a00| 3e 68 6f 73 74 5f 61 64 | 64 72 2e 73 5f 61 64 64 |>host_ad|dr.s_add|
|00004a10| 72 20 3d 3d 20 74 68 65 | 5f 61 64 64 72 2e 73 5f |r == the|_addr.s_|
|00004a20| 61 64 64 72 29 20 7b 0a | 09 09 09 72 65 74 75 72 |addr) {.|...retur|
|00004a30| 6e 28 31 29 3b 0a 09 09 | 7d 0a 09 63 75 72 72 65 |n(1);...|}..curre|
|00004a40| 6e 74 5f 69 74 65 6d 3d | 20 63 75 72 72 65 6e 74 |nt_item=| current|
|00004a50| 5f 69 74 65 6d 2d 3e 6e | 65 78 74 3b 0a 09 7d 0a |_item->n|ext;..}.|
|00004a60| 09 72 65 74 75 72 6e 28 | 30 29 3b 0a 7d 0a 0a 72 |.return(|0);.}..r|
|00004a70| 75 70 5f 61 6e 73 77 65 | 72 5f 76 35 28 72 65 70 |up_answe|r_v5(rep|
|00004a80| 6c 79 70 2c 72 61 64 64 | 72 70 29 0a 73 74 72 75 |lyp,radd|rp).stru|
|00004a90| 63 74 20 73 74 61 74 73 | 75 73 65 72 73 20 2a 72 |ct stats|users *r|
|00004aa0| 65 70 6c 79 70 3b 0a 73 | 74 72 75 63 74 20 73 6f |eplyp;.s|truct so|
|00004ab0| 63 6b 61 64 64 72 5f 69 | 6e 20 2a 72 61 64 64 72 |ckaddr_i|n *raddr|
|00004ac0| 70 3b 0a 7b 0a 09 73 74 | 72 75 63 74 20 74 6d 20 |p;.{..st|ruct tm |
|00004ad0| 2a 74 6d 70 5f 74 69 6d | 65 3b 0a 09 73 74 72 75 |*tmp_tim|e;..stru|
|00004ae0| 63 74 20 68 6f 73 74 65 | 6e 74 20 2a 68 70 3b 0a |ct hoste|nt *hp;.|
|00004af0| 09 63 68 61 72 20 2a 68 | 6f 73 74 3b 0a 09 73 74 |.char *h|ost;..st|
|00004b00| 72 75 63 74 20 73 74 61 | 74 73 75 73 65 72 73 20 |ruct sta|tsusers |
|00004b10| 2a 68 6f 73 74 5f 73 74 | 61 74 3b 0a 09 73 74 72 |*host_st|at;..str|
|00004b20| 75 63 74 20 74 6d 20 68 | 6f 73 74 5f 74 69 6d 65 |uct tm h|ost_time|
|00004b30| 3b 0a 09 73 74 72 75 63 | 74 20 74 6d 20 68 6f 73 |;..struc|t tm hos|
|00004b40| 74 5f 75 70 74 69 6d 65 | 3b 0a 09 63 68 61 72 20 |t_uptime|;..char |
|00004b50| 64 61 79 73 5f 62 75 66 | 5b 31 36 5d 3b 0a 09 63 |days_buf|[16];..c|
|00004b60| 68 61 72 20 68 6f 75 72 | 73 5f 62 75 66 5b 31 36 |har hour|s_buf[16|
|00004b70| 5d 3b 0a 0a 09 69 66 28 | 66 69 6e 64 5f 68 6f 73 |];...if(|find_hos|
|00004b80| 74 6e 61 6d 65 28 72 61 | 64 64 72 70 2d 3e 73 69 |tname(ra|ddrp->si|
|00004b90| 6e 5f 61 64 64 72 29 29 | 20 7b 0a 09 09 72 65 74 |n_addr))| {...ret|
|00004ba0| 75 72 6e 28 30 29 3b 0a | 09 7d 0a 0a 09 73 61 76 |urn(0);.|.}...sav|
|00004bb0| 65 5f 68 6f 73 74 6e 61 | 6d 65 28 72 61 64 64 72 |e_hostna|me(raddr|
|00004bc0| 70 2d 3e 73 69 6e 5f 61 | 64 64 72 29 3b 0a 0a 09 |p->sin_a|ddr);...|
|00004bd0| 68 6f 73 74 5f 73 74 61 | 74 20 3d 20 28 73 74 61 |host_sta|t = (sta|
|00004be0| 74 73 75 73 65 72 73 20 | 2a 29 72 65 70 6c 79 70 |tsusers |*)replyp|
|00004bf0| 3b 0a 0a 09 68 70 20 3d | 20 67 65 74 68 6f 73 74 |;...hp =| gethost|
|00004c00| 62 79 61 64 64 72 28 28 | 63 68 61 72 20 2a 29 26 |byaddr((|char *)&|
|00004c10| 72 61 64 64 72 70 2d 3e | 73 69 6e 5f 61 64 64 72 |raddrp->|sin_addr|
|00004c20| 2e 73 5f 61 64 64 72 2c | 0a 09 09 09 20 20 20 73 |.s_addr,|.... s|
|00004c30| 69 7a 65 6f 66 28 73 74 | 72 75 63 74 20 69 6e 5f |izeof(st|ruct in_|
|00004c40| 61 64 64 72 29 2c 20 41 | 46 5f 49 4e 45 54 29 3b |addr), A|F_INET);|
|00004c50| 0a 09 69 66 20 28 68 70 | 29 0a 09 09 68 6f 73 74 |..if (hp|)...host|
|00004c60| 20 3d 20 28 63 68 61 72 | 20 2a 29 68 70 2d 3e 68 | = (char| *)hp->h|
|00004c70| 5f 6e 61 6d 65 3b 0a 09 | 65 6c 73 65 0a 09 09 68 |_name;..|else...h|
|00004c80| 6f 73 74 20 3d 20 28 63 | 68 61 72 20 2a 29 69 6e |ost = (c|har *)in|
|00004c90| 65 74 5f 6e 74 6f 61 28 | 72 61 64 64 72 70 2d 3e |et_ntoa(|raddrp->|
|00004ca0| 73 69 6e 5f 61 64 64 72 | 29 3b 0a 0a 09 69 66 20 |sin_addr|);...if |
|00004cb0| 28 73 74 72 6c 65 6e 28 | 68 6f 73 74 29 20 3e 20 |(strlen(|host) > |
|00004cc0| 31 32 29 0a 09 09 68 6f | 73 74 5b 31 32 5d 20 3d |12)...ho|st[12] =|
|00004cd0| 20 27 5c 30 27 3b 0a 0a | 09 74 6d 70 5f 74 69 6d | '\0';..|.tmp_tim|
|00004ce0| 65 20 3d 20 6c 6f 63 61 | 6c 74 69 6d 65 28 28 74 |e = loca|ltime((t|
|00004cf0| 69 6d 65 5f 74 20 2a 29 | 26 68 6f 73 74 5f 73 74 |ime_t *)|&host_st|
|00004d00| 61 74 2d 3e 63 75 72 74 | 69 6d 65 2e 74 76 5f 73 |at->curt|ime.tv_s|
|00004d10| 65 63 29 3b 0a 09 68 6f | 73 74 5f 74 69 6d 65 20 |ec);..ho|st_time |
|00004d20| 3d 20 2a 74 6d 70 5f 74 | 69 6d 65 3b 0a 0a 09 68 |= *tmp_t|ime;...h|
|00004d30| 6f 73 74 5f 73 74 61 74 | 2d 3e 63 75 72 74 69 6d |ost_stat|->curtim|
|00004d40| 65 2e 74 76 5f 73 65 63 | 20 2d 3d 20 68 6f 73 74 |e.tv_sec| -= host|
|00004d50| 5f 73 74 61 74 2d 3e 62 | 6f 6f 74 74 69 6d 65 2e |_stat->b|oottime.|
|00004d60| 74 76 5f 73 65 63 3b 0a | 0a 09 74 6d 70 5f 74 69 |tv_sec;.|..tmp_ti|
|00004d70| 6d 65 20 3d 20 67 6d 74 | 69 6d 65 28 28 74 69 6d |me = gmt|ime((tim|
|00004d80| 65 5f 74 20 2a 29 26 68 | 6f 73 74 5f 73 74 61 74 |e_t *)&h|ost_stat|
|00004d90| 2d 3e 63 75 72 74 69 6d | 65 2e 74 76 5f 73 65 63 |->curtim|e.tv_sec|
|00004da0| 29 3b 0a 09 68 6f 73 74 | 5f 75 70 74 69 6d 65 20 |);..host|_uptime |
|00004db0| 3d 20 2a 74 6d 70 5f 74 | 69 6d 65 3b 0a 0a 0a 09 |= *tmp_t|ime;....|
|00004dc0| 69 66 20 28 68 6f 73 74 | 5f 75 70 74 69 6d 65 2e |if (host|_uptime.|
|00004dd0| 74 6d 5f 79 64 61 79 20 | 21 3d 20 30 29 0a 09 09 |tm_yday |!= 0)...|
|00004de0| 73 70 72 69 6e 74 66 28 | 64 61 79 73 5f 62 75 66 |sprintf(|days_buf|
|00004df0| 2c 20 22 25 33 64 20 64 | 61 79 25 73 2c 20 22 2c |, "%3d d|ay%s, ",|
|00004e00| 20 68 6f 73 74 5f 75 70 | 74 69 6d 65 2e 74 6d 5f | host_up|time.tm_|
|00004e10| 79 64 61 79 2c 0a 09 09 | 09 28 68 6f 73 74 5f 75 |yday,...|.(host_u|
|00004e20| 70 74 69 6d 65 2e 74 6d | 5f 79 64 61 79 20 3e 20 |ptime.tm|_yday > |
|00004e30| 31 29 20 3f 20 22 73 22 | 20 3a 20 22 22 29 3b 0a |1) ? "s"| : "");.|
|00004e40| 09 65 6c 73 65 0a 09 09 | 64 61 79 73 5f 62 75 66 |.else...|days_buf|
|00004e50| 5b 30 5d 20 3d 20 27 5c | 30 27 3b 0a 0a 09 69 66 |[0] = '\|0';...if|
|00004e60| 20 28 68 6f 73 74 5f 75 | 70 74 69 6d 65 2e 74 6d | (host_u|ptime.tm|
|00004e70| 5f 68 6f 75 72 20 21 3d | 20 30 29 0a 09 09 73 70 |_hour !=| 0)...sp|
|00004e80| 72 69 6e 74 66 28 68 6f | 75 72 73 5f 62 75 66 2c |rintf(ho|urs_buf,|
|00004e90| 20 22 25 32 64 3a 25 30 | 32 64 2c 20 22 2c 0a 09 | "%2d:%0|2d, ",..|
|00004ea0| 09 09 68 6f 73 74 5f 75 | 70 74 69 6d 65 2e 74 6d |..host_u|ptime.tm|
|00004eb0| 5f 68 6f 75 72 2c 20 68 | 6f 73 74 5f 75 70 74 69 |_hour, h|ost_upti|
|00004ec0| 6d 65 2e 74 6d 5f 6d 69 | 6e 29 3b 0a 09 65 6c 73 |me.tm_mi|n);..els|
|00004ed0| 65 0a 09 09 69 66 20 28 | 68 6f 73 74 5f 75 70 74 |e...if (|host_upt|
|00004ee0| 69 6d 65 2e 74 6d 5f 6d | 69 6e 20 21 3d 20 30 29 |ime.tm_m|in != 0)|
|00004ef0| 0a 09 09 09 73 70 72 69 | 6e 74 66 28 68 6f 75 72 |....spri|ntf(hour|
|00004f00| 73 5f 62 75 66 2c 20 22 | 25 32 64 20 6d 69 6e 73 |s_buf, "|%2d mins|
|00004f10| 2c 20 22 2c 20 68 6f 73 | 74 5f 75 70 74 69 6d 65 |, ", hos|t_uptime|
|00004f20| 2e 74 6d 5f 6d 69 6e 29 | 3b 0a 09 09 65 6c 73 65 |.tm_min)|;...else|
|00004f30| 0a 09 09 09 68 6f 75 72 | 73 5f 62 75 66 5b 30 5d |....hour|s_buf[0]|
|00004f40| 20 3d 20 27 5c 30 27 3b | 0a 0a 09 70 72 69 6e 74 | = '\0';|...print|
|00004f50| 66 28 22 25 2d 2a 73 20 | 20 75 70 20 25 39 2e 39 |f("%-*s | up %9.9|
|00004f60| 73 25 39 2e 39 73 25 69 | 20 75 73 65 72 73 2c 20 |s%9.9s%i| users, |
|00004f70| 6c 6f 61 64 20 61 76 65 | 72 61 67 65 3a 20 25 2e |load ave|rage: %.|
|00004f80| 32 66 20 25 2e 32 66 20 | 25 2e 32 66 5c 6e 22 2c |2f %.2f |%.2f\n",|
|00004f90| 0a 09 09 31 32 2c 68 6f | 73 74 2c 64 61 79 73 5f |...12,ho|st,days_|
|00004fa0| 62 75 66 2c 68 6f 75 72 | 73 5f 62 75 66 2c 0a 09 |buf,hour|s_buf,..|
|00004fb0| 09 68 6f 73 74 5f 73 74 | 61 74 2d 3e 75 73 65 72 |.host_st|at->user|
|00004fc0| 73 2c 0a 09 09 28 64 6f | 75 62 6c 65 29 68 6f 73 |s,...(do|uble)hos|
|00004fd0| 74 5f 73 74 61 74 2d 3e | 61 76 65 6e 72 75 6e 5b |t_stat->|avenrun[|
|00004fe0| 30 5d 2f 46 53 43 41 4c | 45 2c 0a 09 09 28 64 6f |0]/FSCAL|E,...(do|
|00004ff0| 75 62 6c 65 29 68 6f 73 | 74 5f 73 74 61 74 2d 3e |uble)hos|t_stat->|
|00005000| 61 76 65 6e 72 75 6e 5b | 31 5d 2f 46 53 43 41 4c |avenrun[|1]/FSCAL|
|00005010| 45 2c 0a 09 09 28 64 6f | 75 62 6c 65 29 68 6f 73 |E,...(do|uble)hos|
|00005020| 74 5f 73 74 61 74 2d 3e | 61 76 65 6e 72 75 6e 5b |t_stat->|avenrun[|
|00005030| 32 5d 2f 46 53 43 41 4c | 45 29 3b 0a 0a 09 72 65 |2]/FSCAL|E);...re|
|00005040| 74 75 72 6e 28 30 29 3b | 0a 7d 0a 72 75 70 5f 61 |turn(0);|.}.rup_a|
|00005050| 6e 73 77 65 72 5f 76 33 | 28 72 65 70 6c 79 70 2c |nswer_v3|(replyp,|
|00005060| 72 61 64 64 72 70 29 20 | 2f 2a 20 54 68 69 73 20 |raddrp) |/* This |
|00005070| 66 75 6e 63 74 69 6f 6e | 20 69 73 20 6d 6f 73 74 |function| is most|
|00005080| 6c 79 20 68 61 63 6b 65 | 64 20 4e 65 74 42 53 44 |ly hacke|d NetBSD|
|00005090| 20 63 6f 64 65 20 2a 2f | 0a 73 74 72 75 63 74 20 | code */|.struct |
|000050a0| 73 74 61 74 73 74 69 6d | 65 20 2a 72 65 70 6c 79 |statstim|e *reply|
|000050b0| 70 3b 0a 73 74 72 75 63 | 74 20 73 6f 63 6b 61 64 |p;.struc|t sockad|
|000050c0| 64 72 5f 69 6e 20 2a 72 | 61 64 64 72 70 3b 0a 7b |dr_in *r|addrp;.{|
|000050d0| 0a 0a 09 73 74 72 75 63 | 74 20 74 6d 20 2a 74 6d |...struc|t tm *tm|
|000050e0| 70 5f 74 69 6d 65 3b 0a | 09 73 74 72 75 63 74 20 |p_time;.|.struct |
|000050f0| 68 6f 73 74 65 6e 74 20 | 2a 68 70 3b 0a 09 63 68 |hostent |*hp;..ch|
|00005100| 61 72 20 2a 68 6f 73 74 | 3b 0a 09 73 74 72 75 63 |ar *host|;..struc|
|00005110| 74 20 73 74 61 74 73 74 | 69 6d 65 20 2a 68 6f 73 |t statst|ime *hos|
|00005120| 74 5f 73 74 61 74 3b 0a | 09 73 74 72 75 63 74 20 |t_stat;.|.struct |
|00005130| 74 6d 20 68 6f 73 74 5f | 74 69 6d 65 3b 0a 09 73 |tm host_|time;..s|
|00005140| 74 72 75 63 74 20 74 6d | 20 68 6f 73 74 5f 75 70 |truct tm| host_up|
|00005150| 74 69 6d 65 3b 0a 09 63 | 68 61 72 20 64 61 79 73 |time;..c|har days|
|00005160| 5f 62 75 66 5b 31 36 5d | 3b 0a 09 63 68 61 72 20 |_buf[16]|;..char |
|00005170| 68 6f 75 72 73 5f 62 75 | 66 5b 31 36 5d 3b 0a 0a |hours_bu|f[16];..|
|00005180| 09 69 66 28 66 69 6e 64 | 5f 68 6f 73 74 6e 61 6d |.if(find|_hostnam|
|00005190| 65 28 72 61 64 64 72 70 | 2d 3e 73 69 6e 5f 61 64 |e(raddrp|->sin_ad|
|000051a0| 64 72 29 29 20 7b 0a 09 | 09 72 65 74 75 72 6e 28 |dr)) {..|.return(|
|000051b0| 30 29 3b 0a 09 7d 0a 0a | 09 73 61 76 65 5f 68 6f |0);..}..|.save_ho|
|000051c0| 73 74 6e 61 6d 65 28 72 | 61 64 64 72 70 2d 3e 73 |stname(r|addrp->s|
|000051d0| 69 6e 5f 61 64 64 72 29 | 3b 0a 0a 09 68 6f 73 74 |in_addr)|;...host|
|000051e0| 5f 73 74 61 74 20 3d 20 | 28 73 74 61 74 73 74 69 |_stat = |(statsti|
|000051f0| 6d 65 20 2a 29 72 65 70 | 6c 79 70 3b 0a 0a 09 68 |me *)rep|lyp;...h|
|00005200| 70 20 3d 20 67 65 74 68 | 6f 73 74 62 79 61 64 64 |p = geth|ostbyadd|
|00005210| 72 28 28 63 68 61 72 20 | 2a 29 26 72 61 64 64 72 |r((char |*)&raddr|
|00005220| 70 2d 3e 73 69 6e 5f 61 | 64 64 72 2e 73 5f 61 64 |p->sin_a|ddr.s_ad|
|00005230| 64 72 2c 0a 09 09 09 20 | 20 20 73 69 7a 65 6f 66 |dr,.... | sizeof|
|00005240| 28 73 74 72 75 63 74 20 | 69 6e 5f 61 64 64 72 29 |(struct |in_addr)|
|00005250| 2c 20 41 46 5f 49 4e 45 | 54 29 3b 0a 09 69 66 20 |, AF_INE|T);..if |
|00005260| 28 68 70 29 0a 09 09 68 | 6f 73 74 20 3d 20 28 63 |(hp)...h|ost = (c|
|00005270| 68 61 72 20 2a 29 68 70 | 2d 3e 68 5f 6e 61 6d 65 |har *)hp|->h_name|
|00005280| 3b 0a 09 65 6c 73 65 0a | 09 09 68 6f 73 74 20 3d |;..else.|..host =|
|00005290| 20 28 63 68 61 72 20 2a | 29 69 6e 65 74 5f 6e 74 | (char *|)inet_nt|
|000052a0| 6f 61 28 72 61 64 64 72 | 70 2d 3e 73 69 6e 5f 61 |oa(raddr|p->sin_a|
|000052b0| 64 64 72 29 3b 0a 0a 09 | 69 66 20 28 73 74 72 6c |ddr);...|if (strl|
|000052c0| 65 6e 28 68 6f 73 74 29 | 20 3e 20 31 32 29 0a 09 |en(host)| > 12)..|
|000052d0| 09 68 6f 73 74 5b 31 32 | 5d 20 3d 20 27 5c 30 27 |.host[12|] = '\0'|
|000052e0| 3b 0a 0a 09 74 6d 70 5f | 74 69 6d 65 20 3d 20 6c |;...tmp_|time = l|
|000052f0| 6f 63 61 6c 74 69 6d 65 | 28 28 74 69 6d 65 5f 74 |ocaltime|((time_t|
|00005300| 20 2a 29 26 68 6f 73 74 | 5f 73 74 61 74 2d 3e 63 | *)&host|_stat->c|
|00005310| 75 72 74 69 6d 65 2e 74 | 76 5f 73 65 63 29 3b 0a |urtime.t|v_sec);.|
|00005320| 09 68 6f 73 74 5f 74 69 | 6d 65 20 3d 20 2a 74 6d |.host_ti|me = *tm|
|00005330| 70 5f 74 69 6d 65 3b 0a | 0a 09 68 6f 73 74 5f 73 |p_time;.|..host_s|
|00005340| 74 61 74 2d 3e 63 75 72 | 74 69 6d 65 2e 74 76 5f |tat->cur|time.tv_|
|00005350| 73 65 63 20 2d 3d 20 68 | 6f 73 74 5f 73 74 61 74 |sec -= h|ost_stat|
|00005360| 2d 3e 62 6f 6f 74 74 69 | 6d 65 2e 74 76 5f 73 65 |->bootti|me.tv_se|
|00005370| 63 3b 0a 0a 09 74 6d 70 | 5f 74 69 6d 65 20 3d 20 |c;...tmp|_time = |
|00005380| 67 6d 74 69 6d 65 28 28 | 74 69 6d 65 5f 74 20 2a |gmtime((|time_t *|
|00005390| 29 26 68 6f 73 74 5f 73 | 74 61 74 2d 3e 63 75 72 |)&host_s|tat->cur|
|000053a0| 74 69 6d 65 2e 74 76 5f | 73 65 63 29 3b 0a 09 68 |time.tv_|sec);..h|
|000053b0| 6f 73 74 5f 75 70 74 69 | 6d 65 20 3d 20 2a 74 6d |ost_upti|me = *tm|
|000053c0| 70 5f 74 69 6d 65 3b 0a | 0a 0a 09 69 66 20 28 68 |p_time;.|...if (h|
|000053d0| 6f 73 74 5f 75 70 74 69 | 6d 65 2e 74 6d 5f 79 64 |ost_upti|me.tm_yd|
|000053e0| 61 79 20 21 3d 20 30 29 | 0a 09 09 73 70 72 69 6e |ay != 0)|...sprin|
|000053f0| 74 66 28 64 61 79 73 5f | 62 75 66 2c 20 22 25 33 |tf(days_|buf, "%3|
|00005400| 64 20 64 61 79 25 73 2c | 20 22 2c 20 68 6f 73 74 |d day%s,| ", host|
|00005410| 5f 75 70 74 69 6d 65 2e | 74 6d 5f 79 64 61 79 2c |_uptime.|tm_yday,|
|00005420| 0a 09 09 09 28 68 6f 73 | 74 5f 75 70 74 69 6d 65 |....(hos|t_uptime|
|00005430| 2e 74 6d 5f 79 64 61 79 | 20 3e 20 31 29 20 3f 20 |.tm_yday| > 1) ? |
|00005440| 22 73 22 20 3a 20 22 22 | 29 3b 0a 09 65 6c 73 65 |"s" : ""|);..else|
|00005450| 0a 09 09 64 61 79 73 5f | 62 75 66 5b 30 5d 20 3d |...days_|buf[0] =|
|00005460| 20 27 5c 30 27 3b 0a 0a | 09 69 66 20 28 68 6f 73 | '\0';..|.if (hos|
|00005470| 74 5f 75 70 74 69 6d 65 | 2e 74 6d 5f 68 6f 75 72 |t_uptime|.tm_hour|
|00005480| 20 21 3d 20 30 29 0a 09 | 09 73 70 72 69 6e 74 66 | != 0)..|.sprintf|
|00005490| 28 68 6f 75 72 73 5f 62 | 75 66 2c 20 22 25 32 64 |(hours_b|uf, "%2d|
|000054a0| 3a 25 30 32 64 2c 20 22 | 2c 0a 09 09 09 68 6f 73 |:%02d, "|,....hos|
|000054b0| 74 5f 75 70 74 69 6d 65 | 2e 74 6d 5f 68 6f 75 72 |t_uptime|.tm_hour|
|000054c0| 2c 20 68 6f 73 74 5f 75 | 70 74 69 6d 65 2e 74 6d |, host_u|ptime.tm|
|000054d0| 5f 6d 69 6e 29 3b 0a 09 | 65 6c 73 65 0a 09 09 69 |_min);..|else...i|
|000054e0| 66 20 28 68 6f 73 74 5f | 75 70 74 69 6d 65 2e 74 |f (host_|uptime.t|
|000054f0| 6d 5f 6d 69 6e 20 21 3d | 20 30 29 0a 09 09 09 73 |m_min !=| 0)....s|
|00005500| 70 72 69 6e 74 66 28 68 | 6f 75 72 73 5f 62 75 66 |printf(h|ours_buf|
|00005510| 2c 20 22 25 32 64 20 6d | 69 6e 73 2c 20 22 2c 20 |, "%2d m|ins, ", |
|00005520| 68 6f 73 74 5f 75 70 74 | 69 6d 65 2e 74 6d 5f 6d |host_upt|ime.tm_m|
|00005530| 69 6e 29 3b 0a 09 09 65 | 6c 73 65 0a 09 09 09 68 |in);...e|lse....h|
|00005540| 6f 75 72 73 5f 62 75 66 | 5b 30 5d 20 3d 20 27 5c |ours_buf|[0] = '\|
|00005550| 30 27 3b 0a 0a 09 70 72 | 69 6e 74 66 28 22 25 2d |0';...pr|intf("%-|
|00005560| 2a 73 20 20 75 70 20 25 | 39 2e 39 73 25 39 2e 39 |*s up %|9.9s%9.9|
|00005570| 73 20 6c 6f 61 64 20 61 | 76 65 72 61 67 65 3a 20 |s load a|verage: |
|00005580| 25 2e 32 66 20 25 2e 32 | 66 20 25 2e 32 66 5c 6e |%.2f %.2|f %.2f\n|
|00005590| 22 2c 0a 09 09 31 32 2c | 68 6f 73 74 2c 64 61 79 |",...12,|host,day|
|000055a0| 73 5f 62 75 66 2c 68 6f | 75 72 73 5f 62 75 66 2c |s_buf,ho|urs_buf,|
|000055b0| 0a 09 09 28 64 6f 75 62 | 6c 65 29 68 6f 73 74 5f |...(doub|le)host_|
|000055c0| 73 74 61 74 2d 3e 61 76 | 65 6e 72 75 6e 5b 30 5d |stat->av|enrun[0]|
|000055d0| 2f 46 53 43 41 4c 45 2c | 0a 09 09 28 64 6f 75 62 |/FSCALE,|...(doub|
|000055e0| 6c 65 29 68 6f 73 74 5f | 73 74 61 74 2d 3e 61 76 |le)host_|stat->av|
|000055f0| 65 6e 72 75 6e 5b 31 5d | 2f 46 53 43 41 4c 45 2c |enrun[1]|/FSCALE,|
|00005600| 0a 09 09 28 64 6f 75 62 | 6c 65 29 68 6f 73 74 5f |...(doub|le)host_|
|00005610| 73 74 61 74 2d 3e 61 76 | 65 6e 72 75 6e 5b 32 5d |stat->av|enrun[2]|
|00005620| 2f 46 53 43 41 4c 45 29 | 3b 0a 0a 09 72 65 74 75 |/FSCALE)|;...retu|
|00005630| 72 6e 28 30 29 3b 0a 7d | 0a 62 72 6f 61 64 63 61 |rn(0);.}|.broadca|
|00005640| 73 74 5f 76 35 28 29 0a | 7b 0a 09 73 74 72 75 63 |st_v5().|{..struc|
|00005650| 74 20 73 74 61 74 73 75 | 73 65 72 73 20 68 6f 73 |t statsu|sers hos|
|00005660| 74 5f 73 74 61 74 3b 0a | 09 65 6e 75 6d 20 63 6c |t_stat;.|.enum cl|
|00005670| 6e 74 5f 73 74 61 74 20 | 63 6c 6e 74 5f 73 74 61 |nt_stat |clnt_sta|
|00005680| 74 3b 0a 0a 09 63 6c 6e | 74 5f 73 74 61 74 20 3d |t;...cln|t_stat =|
|00005690| 20 63 6c 6e 74 5f 62 72 | 6f 61 64 63 61 73 74 28 | clnt_br|oadcast(|
|000056a0| 52 53 54 41 54 50 52 4f | 47 2c 20 52 53 54 41 54 |RSTATPRO|G, RSTAT|
|000056b0| 56 45 52 53 5f 55 53 45 | 52 53 2c 20 52 53 54 41 |VERS_USE|RS, RSTA|
|000056c0| 54 50 52 4f 43 5f 53 54 | 41 54 53 2c 0a 09 09 09 |TPROC_ST|ATS,....|
|000056d0| 09 20 20 20 28 78 64 72 | 70 72 6f 63 5f 74 29 20 |. (xdr|proc_t) |
|000056e0| 78 64 72 5f 76 6f 69 64 | 2c 20 30 2c 78 64 72 5f |xdr_void|, 0,xdr_|
|000056f0| 73 74 61 74 73 75 73 65 | 72 73 2c 20 26 68 6f 73 |statsuse|rs, &hos|
|00005700| 74 5f 73 74 61 74 2c 20 | 72 75 70 5f 61 6e 73 77 |t_stat, |rup_answ|
|00005710| 65 72 5f 76 35 29 3b 0a | 09 69 66 20 28 63 6c 6e |er_v5);.|.if (cln|
|00005720| 74 5f 73 74 61 74 20 21 | 3d 20 52 50 43 5f 53 55 |t_stat !|= RPC_SU|
|00005730| 43 43 45 53 53 20 26 26 | 20 63 6c 6e 74 5f 73 74 |CCESS &&| clnt_st|
|00005740| 61 74 20 21 3d 20 52 50 | 43 5f 54 49 4d 45 44 4f |at != RP|C_TIMEDO|
|00005750| 55 54 29 20 7b 0a 09 09 | 66 70 72 69 6e 74 66 28 |UT) {...|fprintf(|
|00005760| 73 74 64 65 72 72 2c 20 | 22 72 75 70 3a 20 25 73 |stderr, |"rup: %s|
|00005770| 5c 6e 22 2c 20 63 6c 6e | 74 5f 73 70 65 72 72 6e |\n", cln|t_sperrn|
|00005780| 6f 28 63 6c 6e 74 5f 73 | 74 61 74 29 29 3b 0a 09 |o(clnt_s|tat));..|
|00005790| 09 65 78 69 74 28 31 29 | 3b 0a 09 7d 0a 09 65 78 |.exit(1)|;..}..ex|
|000057a0| 69 74 28 30 29 3b 0a 7d | 0a 62 72 6f 61 64 63 61 |it(0);.}|.broadca|
|000057b0| 73 74 5f 76 33 28 29 0a | 7b 0a 09 73 74 72 75 63 |st_v3().|{..struc|
|000057c0| 74 20 73 74 61 74 73 74 | 69 6d 65 20 68 6f 73 74 |t statst|ime host|
|000057d0| 5f 73 74 61 74 3b 0a 09 | 65 6e 75 6d 20 63 6c 6e |_stat;..|enum cln|
|000057e0| 74 5f 73 74 61 74 20 63 | 6c 6e 74 5f 73 74 61 74 |t_stat c|lnt_stat|
|000057f0| 3b 0a 0a 09 63 6c 6e 74 | 5f 73 74 61 74 20 3d 20 |;...clnt|_stat = |
|00005800| 63 6c 6e 74 5f 62 72 6f | 61 64 63 61 73 74 28 52 |clnt_bro|adcast(R|
|00005810| 53 54 41 54 50 52 4f 47 | 2c 20 52 53 54 41 54 56 |STATPROG|, RSTATV|
|00005820| 45 52 53 5f 54 49 4d 45 | 2c 20 52 53 54 41 54 50 |ERS_TIME|, RSTATP|
|00005830| 52 4f 43 5f 53 54 41 54 | 53 2c 0a 09 09 09 09 20 |ROC_STAT|S,..... |
|00005840| 20 20 28 78 64 72 70 72 | 6f 63 5f 74 29 20 78 64 | (xdrpr|oc_t) xd|
|00005850| 72 5f 76 6f 69 64 2c 20 | 30 2c 78 64 72 5f 73 74 |r_void, |0,xdr_st|
|00005860| 61 74 73 74 69 6d 65 2c | 20 26 68 6f 73 74 5f 73 |atstime,| &host_s|
|00005870| 74 61 74 2c 20 72 75 70 | 5f 61 6e 73 77 65 72 5f |tat, rup|_answer_|
|00005880| 76 33 29 3b 0a 09 69 66 | 20 28 63 6c 6e 74 5f 73 |v3);..if| (clnt_s|
|00005890| 74 61 74 20 21 3d 20 52 | 50 43 5f 53 55 43 43 45 |tat != R|PC_SUCCE|
|000058a0| 53 53 20 26 26 20 63 6c | 6e 74 5f 73 74 61 74 20 |SS && cl|nt_stat |
|000058b0| 21 3d 20 52 50 43 5f 54 | 49 4d 45 44 4f 55 54 29 |!= RPC_T|IMEDOUT)|
|000058c0| 20 7b 0a 09 09 66 70 72 | 69 6e 74 66 28 73 74 64 | {...fpr|intf(std|
|000058d0| 65 72 72 2c 20 22 72 75 | 70 3a 20 25 73 5c 6e 22 |err, "ru|p: %s\n"|
|000058e0| 2c 20 63 6c 6e 74 5f 73 | 70 65 72 72 6e 6f 28 63 |, clnt_s|perrno(c|
|000058f0| 6c 6e 74 5f 73 74 61 74 | 29 29 3b 0a 09 09 65 78 |lnt_stat|));...ex|
|00005900| 69 74 28 31 29 3b 0a 09 | 7d 0a 09 65 78 69 74 28 |it(1);..|}..exit(|
|00005910| 30 29 3b 0a 7d 0a 69 6e | 74 20 70 6f 69 6e 74 6f |0);.}.in|t pointo|
|00005920| 70 6f 69 6e 74 5f 76 35 | 28 73 65 72 76 65 72 5f |point_v5|(server_|
|00005930| 61 64 64 72 29 0a 73 74 | 72 75 63 74 20 73 6f 63 |addr).st|ruct soc|
|00005940| 6b 61 64 64 72 5f 69 6e | 20 2a 73 65 72 76 65 72 |kaddr_in| *server|
|00005950| 5f 61 64 64 72 3b 0a 7b | 0a 09 73 74 72 75 63 74 |_addr;.{|..struct|
|00005960| 20 73 74 61 74 73 75 73 | 65 72 73 20 68 6f 73 74 | statsus|ers host|
|00005970| 5f 73 74 61 74 3b 0a 09 | 73 74 72 75 63 74 20 73 |_stat;..|struct s|
|00005980| 74 61 74 73 75 73 65 72 | 73 20 2a 73 3b 0a 09 73 |tatsuser|s *s;..s|
|00005990| 74 72 75 63 74 20 74 69 | 6d 65 76 61 6c 20 70 65 |truct ti|meval pe|
|000059a0| 72 74 72 79 5f 74 69 6d | 65 6f 75 74 2c 20 74 6f |rtry_tim|eout, to|
|000059b0| 74 61 6c 5f 74 69 6d 65 | 6f 75 74 3b 0a 09 65 6e |tal_time|out;..en|
|000059c0| 75 6d 20 63 6c 6e 74 5f | 73 74 61 74 20 63 6c 6e |um clnt_|stat cln|
|000059d0| 74 5f 73 74 61 74 3b 0a | 09 69 6e 74 20 73 6f 63 |t_stat;.|.int soc|
|000059e0| 6b 3d 52 50 43 5f 41 4e | 59 53 4f 43 4b 3b 0a 09 |k=RPC_AN|YSOCK;..|
|000059f0| 43 4c 49 45 4e 54 20 2a | 63 6c 69 65 6e 74 3b 0a |CLIENT *|client;.|
|00005a00| 0a 09 70 65 72 74 72 79 | 5f 74 69 6d 65 6f 75 74 |..pertry|_timeout|
|00005a10| 2e 74 76 5f 73 65 63 20 | 3d 20 33 3b 0a 09 70 65 |.tv_sec |= 3;..pe|
|00005a20| 72 74 72 79 5f 74 69 6d | 65 6f 75 74 2e 74 76 5f |rtry_tim|eout.tv_|
|00005a30| 75 73 65 63 20 3d 20 30 | 3b 0a 09 74 6f 74 61 6c |usec = 0|;..total|
|00005a40| 5f 74 69 6d 65 6f 75 74 | 2e 74 76 5f 73 65 63 20 |_timeout|.tv_sec |
|00005a50| 3d 20 31 30 3b 0a 09 74 | 6f 74 61 6c 5f 74 69 6d |= 10;..t|otal_tim|
|00005a60| 65 6f 75 74 2e 74 76 5f | 75 73 65 63 20 3d 20 30 |eout.tv_|usec = 0|
|00005a70| 3b 0a 09 73 20 3d 20 26 | 68 6f 73 74 5f 73 74 61 |;..s = &|host_sta|
|00005a80| 74 3b 0a 0a 09 69 66 28 | 28 63 6c 69 65 6e 74 20 |t;...if(|(client |
|00005a90| 3d 20 63 6c 6e 74 75 64 | 70 5f 63 72 65 61 74 65 |= clntud|p_create|
|00005aa0| 28 73 65 72 76 65 72 5f | 61 64 64 72 2c 20 52 53 |(server_|addr, RS|
|00005ab0| 54 41 54 50 52 4f 47 2c | 20 52 53 54 41 54 56 45 |TATPROG,| RSTATVE|
|00005ac0| 52 53 5f 55 53 45 52 53 | 2c 0a 09 70 65 72 74 72 |RS_USERS|,..pertr|
|00005ad0| 79 5f 74 69 6d 65 6f 75 | 74 2c 20 26 73 6f 63 6b |y_timeou|t, &sock|
|00005ae0| 29 29 20 3d 3d 20 4e 55 | 4c 4c 29 20 7b 0a 09 09 |)) == NU|LL) {...|
|00005af0| 63 6c 6f 73 65 28 73 6f | 63 6b 29 3b 0a 09 09 72 |close(so|ck);...r|
|00005b00| 65 74 75 72 6e 28 30 29 | 3b 0a 09 7d 0a 0a 09 63 |eturn(0)|;..}...c|
|00005b10| 6c 6e 74 5f 73 74 61 74 | 20 3d 20 63 6c 6e 74 5f |lnt_stat| = clnt_|
|00005b20| 63 61 6c 6c 28 63 6c 69 | 65 6e 74 2c 20 52 53 54 |call(cli|ent, RST|
|00005b30| 41 54 50 52 4f 43 5f 53 | 54 41 54 53 2c 20 28 78 |ATPROC_S|TATS, (x|
|00005b40| 64 72 70 72 6f 63 5f 74 | 29 20 78 64 72 5f 76 6f |drproc_t|) xdr_vo|
|00005b50| 69 64 2c 30 2c 0a 09 28 | 78 64 72 70 72 6f 63 5f |id,0,..(|xdrproc_|
|00005b60| 74 29 20 78 64 72 5f 73 | 74 61 74 73 75 73 65 72 |t) xdr_s|tatsuser|
|00005b70| 73 2c 20 26 68 6f 73 74 | 5f 73 74 61 74 2c 20 74 |s, &host|_stat, t|
|00005b80| 6f 74 61 6c 5f 74 69 6d | 65 6f 75 74 29 3b 0a 0a |otal_tim|eout);..|
|00005b90| 09 69 66 28 63 6c 6e 74 | 5f 73 74 61 74 20 3d 3d |.if(clnt|_stat ==|
|00005ba0| 20 52 50 43 5f 53 55 43 | 43 45 53 53 29 20 7b 0a | RPC_SUC|CESS) {.|
|00005bb0| 09 09 72 75 70 5f 61 6e | 73 77 65 72 5f 76 35 28 |..rup_an|swer_v5(|
|00005bc0| 26 68 6f 73 74 5f 73 74 | 61 74 2c 20 73 65 72 76 |&host_st|at, serv|
|00005bd0| 65 72 5f 61 64 64 72 29 | 3b 0a 09 09 63 6c 6e 74 |er_addr)|;...clnt|
|00005be0| 5f 64 65 73 74 72 6f 79 | 28 63 6c 69 65 6e 74 29 |_destroy|(client)|
|00005bf0| 3b 0a 09 09 63 6c 6f 73 | 65 28 73 6f 63 6b 29 3b |;...clos|e(sock);|
|00005c00| 0a 09 09 72 65 74 75 72 | 6e 28 31 29 3b 0a 09 7d |...retur|n(1);..}|
|00005c10| 0a 09 65 6c 73 65 20 7b | 0a 09 09 63 6c 6e 74 5f |..else {|...clnt_|
|00005c20| 64 65 73 74 72 6f 79 28 | 63 6c 69 65 6e 74 29 3b |destroy(|client);|
|00005c30| 0a 09 09 63 6c 6f 73 65 | 28 73 6f 63 6b 29 3b 0a |...close|(sock);.|
|00005c40| 09 09 72 65 74 75 72 6e | 28 30 29 3b 0a 09 7d 0a |..return|(0);..}.|
|00005c50| 09 72 65 74 75 72 6e 28 | 30 29 3b 0a 7d 0a 0a 69 |.return(|0);.}..i|
|00005c60| 6e 74 20 70 6f 69 6e 74 | 6f 70 6f 69 6e 74 5f 76 |nt point|opoint_v|
|00005c70| 33 28 73 65 72 76 65 72 | 5f 61 64 64 72 29 0a 73 |3(server|_addr).s|
|00005c80| 74 72 75 63 74 20 73 6f | 63 6b 61 64 64 72 5f 69 |truct so|ckaddr_i|
|00005c90| 6e 20 2a 73 65 72 76 65 | 72 5f 61 64 64 72 3b 0a |n *serve|r_addr;.|
|00005ca0| 7b 0a 09 73 74 72 75 63 | 74 20 73 74 61 74 73 74 |{..struc|t statst|
|00005cb0| 69 6d 65 20 68 6f 73 74 | 5f 73 74 61 74 3b 0a 09 |ime host|_stat;..|
|00005cc0| 73 74 72 75 63 74 20 74 | 69 6d 65 76 61 6c 20 70 |struct t|imeval p|
|00005cd0| 65 72 74 72 79 5f 74 69 | 6d 65 6f 75 74 2c 20 74 |ertry_ti|meout, t|
|00005ce0| 6f 74 61 6c 5f 74 69 6d | 65 6f 75 74 3b 0a 09 65 |otal_tim|eout;..e|
|00005cf0| 6e 75 6d 20 63 6c 6e 74 | 5f 73 74 61 74 20 63 6c |num clnt|_stat cl|
|00005d00| 6e 74 5f 73 74 61 74 3b | 0a 09 69 6e 74 20 73 6f |nt_stat;|..int so|
|00005d10| 63 6b 3d 52 50 43 5f 41 | 4e 59 53 4f 43 4b 3b 0a |ck=RPC_A|NYSOCK;.|
|00005d20| 09 43 4c 49 45 4e 54 20 | 2a 63 6c 69 65 6e 74 3b |.CLIENT |*client;|
|00005d30| 0a 0a 09 70 65 72 74 72 | 79 5f 74 69 6d 65 6f 75 |...pertr|y_timeou|
|00005d40| 74 2e 74 76 5f 73 65 63 | 20 3d 20 33 3b 0a 09 70 |t.tv_sec| = 3;..p|
|00005d50| 65 72 74 72 79 5f 74 69 | 6d 65 6f 75 74 2e 74 76 |ertry_ti|meout.tv|
|00005d60| 5f 75 73 65 63 20 3d 20 | 30 3b 0a 09 74 6f 74 61 |_usec = |0;..tota|
|00005d70| 6c 5f 74 69 6d 65 6f 75 | 74 2e 74 76 5f 73 65 63 |l_timeou|t.tv_sec|
|00005d80| 20 3d 20 31 30 3b 0a 09 | 74 6f 74 61 6c 5f 74 69 | = 10;..|total_ti|
|00005d90| 6d 65 6f 75 74 2e 74 76 | 5f 75 73 65 63 20 3d 20 |meout.tv|_usec = |
|00005da0| 30 3b 0a 0a 09 69 66 28 | 28 63 6c 69 65 6e 74 20 |0;...if(|(client |
|00005db0| 3d 20 63 6c 6e 74 75 64 | 70 5f 63 72 65 61 74 65 |= clntud|p_create|
|00005dc0| 28 73 65 72 76 65 72 5f | 61 64 64 72 2c 20 52 53 |(server_|addr, RS|
|00005dd0| 54 41 54 50 52 4f 47 2c | 20 52 53 54 41 54 56 45 |TATPROG,| RSTATVE|
|00005de0| 52 53 5f 54 49 4d 45 2c | 0a 09 70 65 72 74 72 79 |RS_TIME,|..pertry|
|00005df0| 5f 74 69 6d 65 6f 75 74 | 2c 20 26 73 6f 63 6b 29 |_timeout|, &sock)|
|00005e00| 29 20 3d 3d 20 4e 55 4c | 4c 29 20 7b 0a 09 09 63 |) == NUL|L) {...c|
|00005e10| 6c 6f 73 65 28 73 6f 63 | 6b 29 3b 0a 09 09 72 65 |lose(soc|k);...re|
|00005e20| 74 75 72 6e 28 30 29 3b | 0a 09 7d 0a 09 63 6c 6e |turn(0);|..}..cln|
|00005e30| 74 5f 73 74 61 74 20 3d | 20 63 6c 6e 74 5f 63 61 |t_stat =| clnt_ca|
|00005e40| 6c 6c 28 63 6c 69 65 6e | 74 2c 20 52 53 54 41 54 |ll(clien|t, RSTAT|
|00005e50| 50 52 4f 43 5f 53 54 41 | 54 53 2c 20 28 78 64 72 |PROC_STA|TS, (xdr|
|00005e60| 70 72 6f 63 5f 74 29 20 | 78 64 72 5f 76 6f 69 64 |proc_t) |xdr_void|
|00005e70| 2c 30 2c 0a 09 28 78 64 | 72 70 72 6f 63 5f 74 29 |,0,..(xd|rproc_t)|
|00005e80| 20 78 64 72 5f 73 74 61 | 74 73 74 69 6d 65 2c 20 | xdr_sta|tstime, |
|00005e90| 28 73 74 61 74 73 74 69 | 6d 65 20 2a 29 26 68 6f |(statsti|me *)&ho|
|00005ea0| 73 74 5f 73 74 61 74 2c | 20 74 6f 74 61 6c 5f 74 |st_stat,| total_t|
|00005eb0| 69 6d 65 6f 75 74 29 3b | 0a 0a 09 69 66 28 63 6c |imeout);|...if(cl|
|00005ec0| 6e 74 5f 73 74 61 74 20 | 3d 3d 20 52 50 43 5f 53 |nt_stat |== RPC_S|
|00005ed0| 55 43 43 45 53 53 29 20 | 7b 0a 09 09 72 75 70 5f |UCCESS) |{...rup_|
|00005ee0| 61 6e 73 77 65 72 5f 76 | 33 28 26 68 6f 73 74 5f |answer_v|3(&host_|
|00005ef0| 73 74 61 74 2c 20 73 65 | 72 76 65 72 5f 61 64 64 |stat, se|rver_add|
|00005f00| 72 29 3b 0a 09 09 63 6c | 6e 74 5f 64 65 73 74 72 |r);...cl|nt_destr|
|00005f10| 6f 79 28 63 6c 69 65 6e | 74 29 3b 0a 09 09 63 6c |oy(clien|t);...cl|
|00005f20| 6f 73 65 28 73 6f 63 6b | 29 3b 0a 09 09 72 65 74 |ose(sock|);...ret|
|00005f30| 75 72 6e 28 31 29 3b 0a | 09 7d 0a 09 65 6c 73 65 |urn(1);.|.}..else|
|00005f40| 20 7b 0a 09 09 63 6c 6e | 74 5f 64 65 73 74 72 6f | {...cln|t_destro|
|00005f50| 79 28 63 6c 69 65 6e 74 | 29 3b 0a 09 09 63 6c 6f |y(client|);...clo|
|00005f60| 73 65 28 73 6f 63 6b 29 | 3b 0a 09 09 72 65 74 75 |se(sock)|;...retu|
|00005f70| 72 6e 28 30 29 3b 0a 09 | 7d 0a 09 72 65 74 75 72 |rn(0);..|}..retur|
|00005f80| 6e 28 30 29 3b 0a 7d 0a | 76 6f 69 64 20 75 73 61 |n(0);.}.|void usa|
|00005f90| 67 65 28 29 0a 7b 0a 09 | 70 72 69 6e 74 66 28 22 |ge().{..|printf("|
|00005fa0| 75 73 61 67 65 3a 20 25 | 73 20 5c 22 68 6f 73 74 |usage: %|s \"host|
|00005fb0| 5c 22 20 2d 75 20 2d 76 | 5c 6e 22 5c 0a 09 09 09 |\" -u -v|\n"\....|
|00005fc0| 22 5c 74 2d 75 5c 74 62 | 72 6f 61 64 63 61 73 74 |"\t-u\tb|roadcast|
|00005fd0| 20 72 65 71 75 65 73 74 | 20 66 6f 72 20 69 6e 66 | request| for inf|
|00005fe0| 6f 20 69 6e 63 6c 75 64 | 69 6e 67 20 75 73 65 72 |o includ|ing user|
|00005ff0| 73 2e 5c 6e 22 5c 0a 09 | 09 09 22 5c 74 2d 76 5c |s.\n"\..|.."\t-v\|
|00006000| 74 70 72 69 6e 74 20 76 | 65 72 73 69 6f 6e 20 61 |tprint v|ersion a|
|00006010| 6e 64 20 65 78 69 74 5c | 6e 22 2c 20 70 72 6f 67 |nd exit\|n", prog|
|00006020| 72 61 6d 5f 6e 61 6d 65 | 29 3b 0a 7d 0a 0a 76 6f |ram_name|);.}..vo|
|00006030| 69 64 20 6d 61 69 6e 28 | 61 72 67 63 2c 61 72 67 |id main(|argc,arg|
|00006040| 76 29 0a 69 6e 74 20 61 | 72 67 63 3b 20 63 68 61 |v).int a|rgc; cha|
|00006050| 72 20 2a 2a 61 72 67 76 | 3b 0a 7b 0a 09 73 74 72 |r **argv|;.{..str|
|00006060| 75 63 74 20 68 6f 73 74 | 65 6e 74 20 2a 68 70 3b |uct host|ent *hp;|
|00006070| 0a 09 73 74 72 75 63 74 | 20 73 6f 63 6b 61 64 64 |..struct| sockadd|
|00006080| 72 5f 69 6e 20 73 65 72 | 76 65 72 5f 61 64 64 72 |r_in ser|ver_addr|
|00006090| 3b 0a 09 63 68 61 72 20 | 63 3b 0a 0a 09 69 66 28 |;..char |c;...if(|
|000060a0| 21 28 70 72 6f 67 72 61 | 6d 5f 6e 61 6d 65 20 3d |!(progra|m_name =|
|000060b0| 20 72 69 6e 64 65 78 28 | 61 72 67 76 5b 30 5d 2c | rindex(|argv[0],|
|000060c0| 27 2f 27 29 29 29 20 0a | 09 09 70 72 6f 67 72 61 |'/'))) .|..progra|
|000060d0| 6d 5f 6e 61 6d 65 20 3d | 20 61 72 67 76 5b 30 5d |m_name =| argv[0]|
|000060e0| 3b 0a 09 65 6c 73 65 20 | 0a 09 09 70 72 6f 67 72 |;..else |...progr|
|000060f0| 61 6d 5f 6e 61 6d 65 2b | 2b 3b 0a 09 0a 09 69 66 |am_name+|+;....if|
|00006100| 28 61 72 67 63 20 3d 3d | 20 31 29 20 7b 0a 09 09 |(argc ==| 1) {...|
|00006110| 62 72 6f 61 64 63 61 73 | 74 5f 76 33 28 29 3b 0a |broadcas|t_v3();.|
|00006120| 09 7d 0a 0a 09 77 68 69 | 6c 65 28 28 63 20 3d 20 |.}...whi|le((c = |
|00006130| 67 65 74 6f 70 74 28 61 | 72 67 63 2c 61 72 67 76 |getopt(a|rgc,argv|
|00006140| 2c 22 68 3f 75 76 22 29 | 29 20 21 3d 20 45 4f 46 |,"h?uv")|) != EOF|
|00006150| 29 0a 09 09 73 77 69 74 | 63 68 28 63 29 20 7b 0a |)...swit|ch(c) {.|
|00006160| 09 09 09 63 61 73 65 20 | 27 76 27 3a 0a 09 09 09 |...case |'v':....|
|00006170| 09 09 09 70 72 69 6e 74 | 66 28 76 65 72 73 69 6f |...print|f(versio|
|00006180| 6e 29 3b 0a 09 09 09 09 | 09 09 65 78 69 74 28 30 |n);.....|..exit(0|
|00006190| 29 3b 0a 09 09 09 63 61 | 73 65 20 27 75 27 3a 0a |);....ca|se 'u':.|
|000061a0| 09 09 09 09 09 09 62 72 | 6f 61 64 63 61 73 74 5f |......br|oadcast_|
|000061b0| 76 35 28 29 3b 0a 09 09 | 09 09 09 09 65 78 69 74 |v5();...|....exit|
|000061c0| 28 30 29 3b 0a 09 09 09 | 63 61 73 65 20 27 3f 27 |(0);....|case '?'|
|000061d0| 3a 0a 09 09 09 63 61 73 | 65 20 27 68 27 3a 0a 09 |:....cas|e 'h':..|
|000061e0| 09 09 64 65 66 61 75 6c | 74 3a 0a 09 09 09 09 09 |..defaul|t:......|
|000061f0| 09 75 73 61 67 65 28 29 | 3b 0a 09 09 09 09 09 09 |.usage()|;.......|
|00006200| 65 78 69 74 28 30 29 3b | 0a 09 09 7d 0a 0a 09 69 |exit(0);|...}...i|
|00006210| 66 28 28 68 70 20 3d 20 | 67 65 74 68 6f 73 74 62 |f((hp = |gethostb|
|00006220| 79 6e 61 6d 65 28 61 72 | 67 76 5b 31 5d 29 29 20 |yname(ar|gv[1])) |
|00006230| 3d 3d 20 4e 55 4c 4c 29 | 20 7b 0a 09 09 66 70 72 |== NULL)| {...fpr|
|00006240| 69 6e 74 66 28 73 74 64 | 65 72 72 2c 22 25 73 3a |intf(std|err,"%s:|
|00006250| 20 63 61 6e 6e 6f 74 20 | 67 65 74 20 68 6f 73 74 | cannot |get host|
|00006260| 6e 61 6d 65 20 25 73 5c | 6e 22 2c 70 72 6f 67 72 |name %s\|n",progr|
|00006270| 61 6d 5f 6e 61 6d 65 2c | 61 72 67 76 5b 31 5d 29 |am_name,|argv[1])|
|00006280| 3b 0a 09 09 65 78 69 74 | 28 2d 31 29 3b 0a 09 7d |;...exit|(-1);..}|
|00006290| 0a 0a 09 62 63 6f 70 79 | 28 68 70 2d 3e 68 5f 61 |...bcopy|(hp->h_a|
|000062a0| 64 64 72 2c 28 63 61 64 | 64 72 5f 74 29 26 73 65 |ddr,(cad|dr_t)&se|
|000062b0| 72 76 65 72 5f 61 64 64 | 72 2e 73 69 6e 5f 61 64 |rver_add|r.sin_ad|
|000062c0| 64 72 2c 20 68 70 2d 3e | 68 5f 6c 65 6e 67 74 68 |dr, hp->|h_length|
|000062d0| 29 3b 0a 09 73 65 72 76 | 65 72 5f 61 64 64 72 2e |);..serv|er_addr.|
|000062e0| 73 69 6e 5f 66 61 6d 69 | 6c 79 20 3d 20 41 46 5f |sin_fami|ly = AF_|
|000062f0| 49 4e 45 54 3b 0a 09 73 | 65 72 76 65 72 5f 61 64 |INET;..s|erver_ad|
|00006300| 64 72 2e 73 69 6e 5f 70 | 6f 72 74 20 3d 20 30 3b |dr.sin_p|ort = 0;|
|00006310| 0a 0a 09 69 66 28 70 6f | 69 6e 74 6f 70 6f 69 6e |...if(po|intopoin|
|00006320| 74 5f 76 35 28 26 73 65 | 72 76 65 72 5f 61 64 64 |t_v5(&se|rver_add|
|00006330| 72 29 20 3d 3d 20 31 29 | 0a 09 09 65 78 69 74 28 |r) == 1)|...exit(|
|00006340| 30 29 3b 0a 09 65 6c 73 | 65 20 69 66 28 70 6f 69 |0);..els|e if(poi|
|00006350| 6e 74 6f 70 6f 69 6e 74 | 5f 76 33 28 26 73 65 72 |ntopoint|_v3(&ser|
|00006360| 76 65 72 5f 61 64 64 72 | 29 20 3d 3d 20 31 29 0a |ver_addr|) == 1).|
|00006370| 09 09 65 78 69 74 28 30 | 29 3b 0a 09 65 6c 73 65 |..exit(0|);..else|
|00006380| 20 0a 09 09 63 6c 6e 74 | 5f 70 63 72 65 61 74 65 | ...clnt|_pcreate|
|00006390| 65 72 72 6f 72 28 70 72 | 6f 67 72 61 6d 5f 6e 61 |error(pr|ogram_na|
|000063a0| 6d 65 29 3b 0a 7d 0a 00 | 00 00 00 00 00 00 00 00 |me);.}..|........|
|000063b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000063f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.